I do not want to output filebeat logs to /var/log/messages.
So, I configured to_syslog
and Environment
, referring to the following article.
Hi ,
is there any way to prevent from filebeat logging to /var/messages ? ,
it logging and sends to logstash every beat
example /var/log/messages
Mar 16 15:27:19 solrc-stg1 filebeat[20876]: 2020-03-16T15:27:19.680+0200 INFO [monitoring] log/log.go:145 Non-zero metrics in the last 30s {"monitoring": {"metrics"
.....
Thanks in advance.
However, they do not work.
Can you please tell me how to do it correctly?
Here are the actual steps I took.
$ vi /etc/filebeat/filebeat.yml
logging: # <- add
to_syslog: false # <- add
$systemctl edit filebeat.service
[Service] # <- add
Environment="BEAT_LOG_OPTS=" # <- add
$ systemctl daemon-reload
$ systemctl restart filebeat
Can anyone give me some good ideas?
Hmmm. I'm not sure, but the following statement worked for me.
$ vi /etc/filebeat/filebeat.yml
logging:
level: info
to_files: true
to_syslog: false
$ systemctl restart filebeat
After the following log, the filebeat log will not appear in the syslog.
$ tail /var/log/messages | grep filebeat
... snip ...
May 17 15:37:46 MY_SERVER filebeat: 2021-05-17T15:37:46.062+0900#011INFO#011[monitoring]#011log/log.go:153#011Uptime: 267h59m3.387902897s
May 17 15:37:46 MY_SERVER filebeat: 2021-05-17T15:37:46.062+0900#011INFO#011[monitoring]#011log/log.go:130#011Stopping metrics logging.
May 17 15:37:46 MY_SERVER filebeat: 2021-05-17T15:37:46.062+0900#011INFO#011instance/beat.go:474#011filebeat stopped.
... snip ...
system
(system)
Closed
June 14, 2021, 9:32am
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.