elasticsearch 有没有办法检查Filebeat是否收到任何UDP数据包?
在我的filebeat.yml文件中,我有以下内容:elasticsearch 有没有办法检查Filebeat是否收到任何UDP数据包?,elasticsearch,udp,logstash,kibana,filebeat,elasticsearch,Udp,Logstash,Kibana,Filebeat,在我的filebeat.yml文件中,我有以下内容: filebeat.inputs: - type: udp host: "localhost:15656" enabled: true output.elasticsearch: hosts: ["localhost:9200"] username: "elastic" password: "changeme" 以下是指南: 我发送了命令:f
filebeat.inputs:
- type: udp
host: "localhost:15656"
enabled: true
output.elasticsearch:
hosts: ["localhost:9200"]
username: "elastic"
password: "changeme"
以下是指南:
我发送了命令:filebeat setup-e后跟sudo服务filebeat start
检查状态表明它正在侦听UDP连接:
Mar 22 11:07:20 ip-172-41-12-144 filebeat[425]: 2021-03-22T11:07:20.706Z INFO udp/input.go:99 Starting UDP input
Mar 22 11:07:20 ip-172-41-12-144 filebeat[425]: 2021-03-22T11:07:20.706Z INFO [UDP] dgram/server.go:96 **Started listening for UDP connection**
Mar 22 11:07:20 ip-172-41-12-144 filebeat[425]: 2021-03-22T11:07:20.707Z INFO cfgfile/reload.go:164 Config reloader started
Mar 22 11:07:20 ip-172-41-12-144 filebeat[425]: 2021-03-22T11:07:20.707Z INFO cfgfile/reload.go:224 Loading of config files completed.
但是我无法知道我是否收到任何UDP数据包。如果在收到数据包时,屏幕上会有输出,那就太好了。我在elasticsearch或kibana中没有看到任何内容,我确信我发送的数据包是正确的,因为logstash可以接收它们。我停止使用logstash,因为它在我的服务器上太慢了,所以我尝试使用filebeat代替它,但我无法让它接收UDP数据包…您可以做的是替换的
elasticsearch
输出,以便您接收的每个事件都将显示在您的终端上:
#output.elasticsearch:
# hosts: ["localhost:9200"]
# username: "elastic"
# password: "changeme"
output.console:
pretty: true
我必须运行“systemctl stop filebeat”。然后在您建议的更改之后手动运行(usr/share/filebeat/bin#/filebeat-e-c/etc/filebeat/filebeat.yml),但我得到的只是在终端中输出的信息:INFO[monitoring]log/log.go:144个非零指标,在过去30秒内,后跟一些信息。有什么想法吗?那意味着没有任何东西通过港口。试着自己生成一些假数据:
nc-u localhost 15656
谢谢,我能够确定设置是错误的。将output.elasticsearch主机更改为“0.0.0.0”,而不是“localhost”。看起来elasticsearch.yml也有0.0.0.0,所以我刚把地址弄错了太棒了,很高兴你能猜出来