-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Multiline logs split when rotated by Kubelet (containerd) #4094
Comments
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days |
Are there any updates on this? Keen to get this resolved. |
Sorry for the delay. This looks like an issue of fluent-plugin-concat. Isn't the Although it would be a less likely case that the rotation would take more than 5 seconds, Anyway, to narrow down the cause, we should check if this log message occurs during the rotation. Example: [info]: #0 following tail of /test/fluentd/input/test.log
[info]: #0 fluentd worker is now running worker=0
(datetime) test: {"message":"[START]Hello"}
[info]: #0 Timeout flush: test:default
[info]: #0 following tail of /test/fluentd/input/test2.log
(datetime) test: {"message":"World![END]"} |
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days |
This issue was automatically closed because of stale in 7 days |
Describe the bug
We are running Fluentd in a Kubernetes environment using the containerd runtime and having logs rotated by the Kubelet when they reach 10MB in size and retaining the last four plus the current log. When the log rotation happens when a large multi-line log is being written and therefore gets split across the old and the new log file, the log is picked up by Fluentd as many single-line logs rather than a multiline log.
To Reproduce
Expected behavior
A multi-line log that get split across two files when our logs get rotated should still be picked up as a single log entry by Fluentd.
Your Environment
Your Configuration
Your Error Log
Additional context
When the Kubelet does the log rotation it swaps the current log and the most recently rotated log's inodes around as follows:
The text was updated successfully, but these errors were encountered: