Delete filebeat processed file

Hi, does filebeat has a feature that will delete the file after it is processed?
Or anyone has an idea how to delete the source file itself when all the data has been read?

Thanks in advance!

It does not have that option.

Something like cat file | filebeat .... && rm file would work, but you'd need to call it somehow. That does assume the file would process without errors as well, which is a risk if it doesn't.

Filebeat maintains a registry file which contains the number of bytes read by each file.
You can write a cronjob to delete the file if the bytes read is equal to the size of the file.
On Linux, the file is present at /var/lib/filebeat/registry.

Although this is not a clean solution and it would be great if Filebeat can provide an inbuilt feature that does this.

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