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

Log files are rotated on startup when interval is configured and rotateonstartup is disabled #41894

Closed
nicholasberlin opened this issue Dec 4, 2024 · 1 comment · Fixed by #41895
Labels
bug Team:Security-Linux Platform Linux Platform Team in Security Solution

Comments

@nicholasberlin
Copy link
Contributor

With the following logging configuration

logging.level: info
logging.to_files: true
logging.files:
  path: /usr/share/packetbeat/logs
  name: packetbeat
  interval: 24h
  keepfiles: 14
  permissions: 0640
  rotateonstartup: false
  rotateeverybytes: 1048576000
  suffix: date

The expected behavior is for the log files to rotate daily as long as the size does not go over 1GB. However, despite rotateonstartup: false, the logs rotate on next startup.

Version: 8.15.4
Operating System: Linux
Steps to reproduce:

% sudo ./packetbeat      
^C                                                                                                                                                                                                     
% ls /tmp/packetbeat/logs
packetbeat-20241126-1.ndjson    packetbeat-20241126.ndjson
% sudo ./packetbeat      
^C                                                                                                                                                                                                     
% ls /tmp/packetbeat/logs
packetbeat-20241126-1.ndjson    packetbeat-20241126-2.ndjson    packetbeat-20241126.ndjson
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 4, 2024
@nicholasberlin nicholasberlin added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Dec 4, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 4, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

nicholasberlin added a commit that referenced this issue Dec 6, 2024
Fix a bug where log files are rotated on startup when interval is configured 
and rotateonstartup is disabled.

Closes: #41894

Relates: elastic/elastic-agent-libs#259
mergify bot pushed a commit that referenced this issue Dec 6, 2024
Fix a bug where log files are rotated on startup when interval is configured
and rotateonstartup is disabled.

Closes: #41894

Relates: elastic/elastic-agent-libs#259
(cherry picked from commit b1cc7c5)
nicholasberlin added a commit that referenced this issue Dec 9, 2024
Fix a bug where log files are rotated on startup when interval is configured
and rotateonstartup is disabled.

Closes: #41894

Relates: elastic/elastic-agent-libs#259
(cherry picked from commit b1cc7c5)
nicholasberlin added a commit that referenced this issue Dec 9, 2024
Fix a bug where log files are rotated on startup when interval is configured
and rotateonstartup is disabled.

Closes: #41894

Relates: elastic/elastic-agent-libs#259
(cherry picked from commit b1cc7c5)

Co-authored-by: Nicholas Berlin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Security-Linux Platform Linux Platform Team in Security Solution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants