The documented default value for Filebeat's logging.files.keepfiles
is 7, but in my testing this doesn't seem to be accurate. The actual default seems to be 0, meaning Filebeat doesn't keep any rotated log files.
How to reproduce:
- Install filebeat (I'm running 6.3.0 on Ubuntu 14.04 from the Elastic Apt repository).
- Confirm that
/etc/filebeat/filebeat.yml
does not define any value forlogging.files.keepfiles
. - Start the service:
service filebeat start
. - Confirm that a log file is created at
/var/log/filebeat/filebeat
. - Restart the service:
service filebeat restart
, triggering a log rotate. - Confirm that the previous log file was overwritten when it should have been rotated: only one file exists under
/var/log/filebeat
. - Explicitly set
logging.files.keepfiles: 7
in/etc/filebeat/filebeat.yml
. - Restart the service:
service filebeat restart
, triggering another log rotate. - Confirm that the previous log file was rotated correctly, and now exists at
/var/log/filebeat/filebeat.1
.
I've searched but can't find any previous reports of this bug. Should I file an issue?