使用filebeat采集日志,输入到logstash,发现如果日志文件新增一条记录,filebeat会将所有的记录输入到logstash(全量采集),而不是最新的一条(增量采集)
filebeat版本:
filebeat version 6.1.1 (amd64), libbeat 6.1.1
filebeat配置:
filebeat.prospectors:
- type: log
paths:
- /Users/king/max/logs/test.log
tail_files: true
output.logstash:
hosts: ["localhost:5044"]
logstash版本:
logstash 6.1.1
logstash配置:
input {
beats {
port => "5044"
}
}
filter {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}"}
}
}
output {
stdout { codec => rubydebug }
}
日志格式:
83.149.9.216 - - [04/Jan/2015:05:13:42 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77
我手动往log文件里插一条数据,filebeat总是会采集所有的日志记录输入到logstash,网上查了半天,也没啥结论,求大神支招,谢谢~
已解决:https://discuss.elastic.co/t/...