logstash-plugins / logstash-output-file

Apache License 2.0
23 stars 53 forks source link

made stale_cleanup_interval configurable #84

Closed NirBenor closed 4 years ago

NirBenor commented 4 years ago

This PR makes stale_cleanup_interval configurable. A file that is periodically written to may be closed and then reopened and written to again.

Example: a minute-based file.

filter {
    ruby {
        code => "
            event.set('[@metadata][system_time]', Time.now.utc.strftime('%Y%m%d_%H%M'))
        "
    }
}
output {
 file {
   path => /var/logstash/output/%{[@metadata][system_time]}.txt.gz
   codec => json_lines
   gzip => true
   id => "file_output_plugin"
 }

Also solves #59 .

andsel commented 4 years ago

Hi @NirBenor thanks for your contribution, I'll check it out in the next days probably updating the documentation to describe the new setting