无论才能、知识多么卓著,如果缺乏热情,则无异纸上画饼充饥,无补于事。

filebeat 重复Publish

Beats | 作者 Ohhhhhhhhhhhh! | 发布于2018年01月10日 | 阅读数:11018

filebeat配置:
  1 filebeat.prospectors:
2 - type: log
3 paths:
4 - /Users/king/logstash/logs/bayes.log
5 tail_files: true
6
7 filebeat.shutdown_timeout: 5s
8
9 output.logstash:
10 hosts: ["localhost:5044"]
logstash 配置:
  1 input {
2 beats {
3 port => "5044"
4 }
5 }
6
7 filter{
10 grok {
11 match => {
12 "message" => "(?<request_time>\d\d:\d\d:\d\d\.\d+)\s+\[(?<thread_id>[\w\-]+)\]\s+(?<log_level>\w+)\s+(?<class_name>\w+)\s+\-(?<detail>.+)"
13 }
14 }
15 }
16
17 output {
18 stdout { codec => rubydebug }
19 }
 
bayes.log 每次新增record,filebeat都会publish所有的record。
filebeat publish event 后的日志:
2018/01/10 07:58:49.044372 metrics.go:39: INFO Non-zero metrics in the last 30s: beat.info.uptime.ms=30000 beat.memstats.gc_next=5695216 beat.memstats.memory_alloc=2871816 beat.memstats.memory_total=4431568 filebeat.events.added=6 filebeat.events.done=6 filebeat.harvester.open_files=1 filebeat.harvester.running=1 filebeat.harvester.started=1 libbeat.config.module.running=0 libbeat.output.events.acked=4 libbeat.output.events.batches=1 libbeat.output.events.total=4 libbeat.output.read.bytes=6 libbeat.output.write.bytes=500 libbeat.pipeline.clients=1 libbeat.pipeline.events.active=0 libbeat.pipeline.events.filtered=2 libbeat.pipeline.events.published=4 libbeat.pipeline.events.retry=4 libbeat.pipeline.events.total=6 libbeat.pipeline.queue.acked=4 registrar.states.cleanup=1 registrar.states.current=1 registrar.states.update=6 registrar.writes=3
根据网上查询的解决方案,加入了下面的配置,还是不行
tail_files: true
filebeat.shutdown_timeout: 5s

请问有人知道是怎么回事吗?
谢谢~
 
已邀请:

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自: lianjie

你截图的这个 Non-zero metrics 是 filebeat 的统计信息。你们是怎么判定数据重复发送的?能否有重现的方法?

medcl - 今晚打老虎。

赞同来自:

filebeat完整的配置就是上面的那些么?Filebeat 是什么版本?有没有试过最新的版本?

yangbiao

赞同来自:

我也是这个问题,filebeat监控的文件每次做了修改都会重新publish所有的record

football025

赞同来自:

不要直接修改,replace等,要么你重新发布服务,别只是改配置文件,那样就是会全部重新读取的

hlsa816215

赞同来自:

我是也遇到这个问题,却不知道产生这个问题的原因,以及如何修复
filebeat_INFO.png

要回复问题请先登录注册