无法将Filebeat连接到logstash以使用ELK进行日志记录

问题描述:

您好我一直在使用弹性堆栈进行自动日志记录。我有filebeat正在从路径中读取日志,输出设置为通过端口5044的logstash。 logstash配置有一个输入,它监听5044并输出推送到localhost:9200。问题是我无法让它工作,我不知道发生了什么。下面是这些文件:无法将Filebeat连接到logstash以使用ELK进行日志记录

我filebeat.yml路径:etc/filebeat/filebeat.yml

#=========================== Filebeat prospectors ============================= 

filebeat.prospectors: 

# Each - is a prospector. Most options can be set at the prospector level, so 
# you can use different prospectors for various configurations. 
# Below are the prospector specific configurations. 

- input_type: log 

# Paths that should be crawled and fetched. Glob based paths. 
paths: 
- /mnt/vol1/autosuggest/logs/*.log 
#- c:\programdata\elasticsearch\logs\* 
<other commented stuff> 
#----------------------------- Logstash output -------------------------------- 
output.logstash: 
# The Logstash hosts 
hosts: ["10.10.XX.XX:5044"] 

# Optional SSL. By default is off. 
<other commented stuff> 

我logstash.yml路径:etc/logstash/logstash.yml

<other commented stuff> 
path.data: /var/lib/logstash 
<other commented stuff> 
path.config: /etc/logstash/conf.d 
<other commented stuff> 

# ------------ Metrics Settings -------------- 
# 
# Bind address for the metrics REST endpoint 
# 
http.host: "10.10.XX.XX" 
# 
# Bind port for the metrics REST endpoint, this option also accept a range 
# (9600-9700) and logstash will pick up the first available ports. 
# 
# http.port: 9600-9700 
<other commented stuff> 
path.logs: /var/log/logstash 
<other commented stuff> 

我logpipeline30aug.config文件路径:/usr/share/logstash

input { 
    beats { 
    port => 5044 
    } 
} 

filter { 
    grok { 
match => { "message" => "\A%{TIMESTAMP_ISO8601:timestamp}%{SPACE}%{WORD:var0}%{SPACE}%{NOTSPACE}%{SPACE}(?<searchinfo>[^#]*)#(?<username>[^#]*)#(?<searchQuery>[^#]*)#(?<latitude>[^#]*)#(?<longitude>[^#]*)#(?<client_ip>[^#]*)#(?<responseTime>[^#]*)" } 
    } 
} 

output { 
    elasticsearch { 
     hosts => ["http://localhost:9200"] 
     index => "logstash30aug2017" 
     document_type => "log" 
    } 
} 

请注意: Elasticsearch,logstash,filebeat都安装在同一台机器上使用IP:10.10.XX.XX和我检查防火墙,这不是问题是肯定的。

我检查logstash,filebeat服务都在运行。 Filebeat可以在配置时将数据推送到elasticsearch,logstash可以在配置时将数据推送到elasticsearch。


也许这是我如何执行过程中的问题.. 我在做一个/usr/share/logstashbin/logstash -f logpipeline30aug.config启动它,然后我从根目录/etc/init.d/filebeat start

请注意:格式可能会影响由于*的格式问题

是否有人可以帮忙吗?自3天以来,我一直在尝试一切,我也浏览了文档

您的filebeat.yml看起来无效。

输出部分缺乏一个缺口:

output.logstash: 
    hosts: ["10.10.XX.XX:5044"] 

一般情况下,检查配置文件的正确性,以确保它们正常。

例如,对于filebeat,你可以运行:

filebeat -c /etc/filebeat/filebeat.yml -configtest 

如果您有任何错误,它解释了什么是错误,所以你可以修复它。

您可以使用其他ELK服务类似的方法,以及

+0

它的存在,这是一个计算器格式问题 –

+0

什么filebeat的输出? – whites11

+0

什么都没有发生 –