Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect default for Filebeat logging.files.keepfiles #7494

Closed
lachlancooper opened this issue Jul 3, 2018 · 1 comment
Closed

Incorrect default for Filebeat logging.files.keepfiles #7494

lachlancooper opened this issue Jul 3, 2018 · 1 comment
Labels
bug good first issue Indicates a good issue for first-time contributors libbeat

Comments

@lachlancooper
Copy link

The documented default 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.

  1. Install Filebeat.
  2. Confirm that /etc/filebeat/filebeat.yml does not define any value for logging.files.keepfiles.
  3. Start the service: service filebeat start.
  4. Confirm that a log file is created at /var/log/filebeat/filebeat.
  5. Restart the service: service filebeat restart, triggering a log rotate.
  6. Confirm that the previous log file was overwritten when it should have been rotated: only one file exists under /var/log/filebeat.
  7. Explicitly set logging.files.keepfiles: 7 in /etc/filebeat/filebeat.yml.
  8. Restart the service: service filebeat restart, triggering another log rotate.
  9. Observe behaviour change: the previous log file was rotated correctly, and now exists at /var/log/filebeat/filebeat.1.
@andrewkroh
Copy link
Member

andrewkroh commented Jul 3, 2018

Looks like we need to add MaxBackups: 7 here. It was a regression during the logp refactoring around ~v6.2.

https://github.com/elastic/beats/blob/v6.3.0/libbeat/logp/config.go#L36-L39

@andrewkroh andrewkroh added the good first issue Indicates a good issue for first-time contributors label Jul 3, 2018
andrewkroh added a commit to andrewkroh/beats that referenced this issue Jul 3, 2018
The config files and docs state that the default number of backups to keep is 7. This default value in the code was lost during the logging refactor.

Fixes elastic#7494
adriansr pushed a commit that referenced this issue Jul 3, 2018
The config files and docs state that the default number of backups to keep is 7. This default value in the code was lost during the logging refactor.

Fixes #7494
andrewkroh added a commit to andrewkroh/beats that referenced this issue Jul 3, 2018
The config files and docs state that the default number of backups to keep is 7. This default value in the code was lost during the logging refactor.

Fixes elastic#7494

(cherry picked from commit 94fe58a)
ruflin pushed a commit that referenced this issue Jul 4, 2018
The config files and docs state that the default number of backups to keep is 7. This default value in the code was lost during the logging refactor.

Fixes #7494

(cherry picked from commit 94fe58a)
leweafan pushed a commit to leweafan/beats that referenced this issue Apr 28, 2023
The config files and docs state that the default number of backups to keep is 7. This default value in the code was lost during the logging refactor.

Fixes elastic#7494

(cherry picked from commit 4389d7b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Indicates a good issue for first-time contributors libbeat
Projects
None yet
Development

No branches or pull requests

2 participants