Log-rotation with Beats

I am trying to figure out the best possible method for enabling log rotation.
The beats is deployed in Kubernetes as daemon set, its input file is stored in a shared location accessed by multiple pods, writing to it.
As suggested by docs, when I tried to rename the log file and create a new file, Application was not able to detect the new file and kept writing to the rotated log file. In order for the application to detect the new file, restart will be required but that might lead to data loss.
Copy and truncate seems to be an option, but that leads to data loss in filebeat.
Is there any way to over come this..

Thank you for your help in advance! :slight_smile:

Hi!

You are right that copy/truncate method will lead in data loss. I think that copy/create (default method for docker runtime) is a safe method to use. See more at Run Filebeat on Kubernetes | Filebeat Reference [7.12] | Elastic

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.