5

Recently we had a message fill up /var/log/libvirt/qemu/.log in a matter of minutes with a line that repeated that crashed our system due to the root partition being filled (20+ Gigs in minutes).

"block I/O error in device 'drive-virtio-disk0': Operation not permitted (1)"

Is there a way to ensure that duplicate lines are not pushed into logs, or a way to limit that directory from filling up? Logstash maxsize will not work for us since we run it on a daily cronjob.

ChanceB
  • 75
  • 2
  • 7

1 Answers1

5

It depends on which logging utility you are using (rsyslog or syslog-ng)

Rsyslog can remove repeated messages by adding lines like: "last message repeated 3044 times". To enable this option you should add:

$RepeatedMsgReduction on

to /etc/rsyslog.conf

I don't know if such reduction is possible with syslog-ng.

Both syslog-ng and rsyslog can completely remove lines matching some pattern:

Community
  • 1
  • 1