How to avoid outputting filebeat logs to /var/log/messages

I do not want to output filebeat logs to /var/log/messages.
So, I configured to_syslog and Environment, referring to the following article.

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 ...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.