Deleting files after logstash processes them

(4b3l) #1


I would like to know if there is a way of deleting log files once logstash has finished processing.

We have files sent to an input folder, logstash then processes them. I would like to clear them down once it is done (as we no longer need the files anymore). Reading through posts, logstash doesn't provide anything out of box (would be a nice enhancement :slight_smile: ).

How does everyone deal with this? Is it just a case of dumping the files to the input directory and then wait 24hours before removing?

This is on a Centos 7 environment, so not sure if there is a linux command to monitor the file itself?

(Christian Dahlqvist) #2

The latest version of the file input plugin has a read mode that I think support what you are looking for though the file_completed_action parameter. You may need to explicitly upgrade the plugin to get this version.

(system) #3

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