I use logrotate utility and it executes ftruncate(fdcurr, 0) in copytruncate mode
When it truncates file which Filebeat was reading, Will Filebeat's offset reset to zero or throw error?
Thanks
I use logrotate utility and it executes ftruncate(fdcurr, 0) in copytruncate mode
When it truncates file which Filebeat was reading, Will Filebeat's offset reset to zero or throw error?
Thanks
It will resume to read the file from the beginning. It also emits the following message: "File was truncated. Begin reading file from offset 0"
.
Looks good. Thanks a lot
But please note, if Filebeat hasn't finished processing the file and logrotate truncates the file, it can lead to log loss.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.