我正在学习使用 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 中没有很好地显示
这些类型的日志可以在 filebeat.yml 集中禁用: