filebeat 每秒记录 30 条状态

filebeat 每秒记录 30 条状态

我正在学习使用 ELK,并且有一台作为测试客户端运行的 Debian PC。每 30 秒它会记录一条消息:

021-01-18T08:29:59.656-0500#011INFO#011[monitoring]#011log/log.go:145#011Non-zero metrics in the last 30s#011{"monitoring": {"metrics": {"beat":{"cgroup":{"memory":{"mem":{"usage":{"bytes":4096}}}},"cpu":{"system":{"ticks":171310,"time":{"ms":11}},"total":{"ticks":433770,"time":{"ms":24},"value":433770},"user":{"ticks":262460,"time":{"ms":13}}},"handles":{"limit":{"hard":524288,"soft":1024},"open":13},"info":{"ephemeral_id":"e83bbdd5-2482-4ac4-85b9-5b50f2b64e7c","uptime":{"ms":444690082}},"memstats":{"gc_next":20543200,"memory_alloc":12804128,"memory_total":20951973208},"runtime":{"goroutines":54}},"filebeat":{"events":{"added":2,"done":2},"harvester":{"open_files":2,"running":2}},"libbeat":{"config":{"module":{"running":1}},"output":{"events":{"acked":2,"batches":2,"total":2},"read":{"bytes":681},"write":{"bytes":4714}},"pipeline":{"clients":3,"events":{"active":0,"published":2,"total":2},"queue":{"acked":2}}},"registrar":{"states":{"current":15,"update":2},"writes":{"success":2,"total":2}},"system":{"load":{"1":0,"15":0,"5":0,"norm":{"1":0,"15":0,"5":0}}}}}}

我不想每 30 秒出现一次这种情况,因此我创建了一个 filebeat.yml 以在 filebeat 中将其过滤掉

在路径部分下我写了

exclude_lines :['^INFO#011[monitoring]#011log/log.go:145#011Non-zero']

没有效果,应该怎么排线?

我有几个问题,

  • 如果不是每 30 秒记录一次,那对我来说没问题,这个状态可以每 5 分钟记录一次吗?
  • 好吧,我是 ELK 的新手,我认为这行不应该出现在 filebeat 中(因为它应该记录系统的日志而不是内存统计信息,还是我读错了?)另一方面,了解这些统计数据并不坏,但为什么它不能很好地显示在 Gui 中

答案1

可以在 filebeat.yml 集中禁用这些类型的日志:

logging.metrics.enabled: false  
# by default its true

相关内容