Is there a good way to have filebeat let go of the filehandle for a file after a certain amount of inactivity to the file?
We are running into the following problem:
- Filebeat is tracking FileA
- The output target goes down, so Filebeat is unable to ship any additional log lines for FileA
- FileA is deleted (rotated, disk cleanup, etc)
- Since Filebeat still holds onto the filehandle, the OS never reclaims that disk space.
We have a few systems that produce a large number of temporary logs with very verbose log lines and when the above happens, over time, disk space can get filled up. In this scenario, if we have to choose between disk space filling and the service failing, or, failing to ship some log lines, we'd rather choose the latter.
It seems to me that close_inactive should kick in after the default of 5m and allow the file to be closed, but that doesn't seem to be working. We've also tried setting close_timeout with no luck.