I am using filebeat image - docker.elastic.co/beats/filebeat:5.4.1 to setup filebeat container locally on windows to read logs from an application and send data to logstash. The application which generate logs will rotate it after '1MB' size.
I have set close_inactive = 2M. So that filebeat release the handle after 2 minutes.
When application stops writing data and all the data is read from the file, file handle is released. This is as expected.
My concern is,
While filebeat container is reading the file, application is not able to rotate the log file after 1MB size.
If i run filebeat as a service (Not inside docker) it works as expected i.e logs are rotated after 1MB.
Based on that output where VBoxHeadless.exe has the log file open with RW-, I'd say that the shared filesystem used by VirtualBox is to blame. It is not opening the file with FILE_SHARE_DELETE so other applications cannot delete or rename the file.
I'm not aware of way to avoid this, but it's also not something I've encountered. Trying the Hyper-V driver would be an interesting test. Also trying Windows native containers would be interesting (note that Elastic doesn't provide a Windows container image).
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.