Closed runningman84 closed 6 years ago
How would this behave if Logstash is unexpectedly restarted, i.e. how would Logstash know whether the file really should be overwritten?
Just write a new file instead of appending. Use case would be to monitor when the file was modified in order to know if logstash is up and running.
If all you want is an indicator of whether Logstash is running there are other ways of doing that. While the feature you're asking for sounds reasonable I don't think your particular case is a very good justification.
FWIW I'd like to use this feature to aggregate metrics. This would prevent me having to add a post processing step to SUM metric counts.
+1 for this feature. I mean, you can check if logstash is up in different way, but I feel this quite a convenient way to work with heartbeats. at the moment i push them to a rabbitmq and worker to rewrite that file.
+1 for this feature. For exactly the same reason as described by @ambivalentno - implementing simple healthcheck
Happy anniversary, issue #24. You could also use the functionality to generate yml files for the translate{} filter - within logstash itself!
For my project, I write the file to "dict.yml.new" every 5 minutes, and have a cron job that mv's that to "dict.yml". That protects me if the original data source is unavailable, as logstash caches the old file until a new one appears.
While I do not recommend using this strategy for health checking (Logstash 5.0 has an API for monitoring behavior), I don't have any disagreements with the proposed feature.
I have submitted PR #50 to implement this.
Is this a hidden feature? Not documented here https://github.com/logstash-plugins/logstash-output-file/blob/master/docs/index.asciidoc or https://www.elastic.co/guide/en/logstash/6.0/plugins-outputs-file.html
I would like to use the file output to overwrite an existing file. Right now the new content is appended at the end of the existing file which keeps this file growing.
https://github.com/elastic/logstash/issues/4337