# Logstash file output truncate on startup

**URL:** <https://discuss.elastic.co/t/logstash-file-output-truncate-on-startup/190616>\
**Category:** Logstash\
**Created:** [July 15, 2019, 9:35pm UTC](https://discuss.elastic.co/t/logstash-file-output-truncate-on-startup/190616 "2019-07-15T21:35:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sous\_Lesquels](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sous_lesquels/32/41843_2.png) [@Sous\_Lesquels](https://discuss.elastic.co/u/Sous_Lesquels)\
**Post date:** [July 15, 2019, 9:35pm UTC](https://discuss.elastic.co/t/logstash-file-output-truncate-on-startup/190616/1 "2019-07-15T21:35:09Z")

</div>

Is there a way to tell logstash file output plugin to truncate files on startup only?

I would find this useful when testing. I.e. test the config, see the error, save an update to config, logstash re-reads the config and truncates the files, thus creating a new set of output files without the old contents that are presumably wrong due to a config issue.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 15, 2019, 9:47pm UTC](https://discuss.elastic.co/t/logstash-file-output-truncate-on-startup/190616/2 "2019-07-15T21:47:31Z")

</div>

I do not think so, but it might be a useful enhancement.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 12, 2019, 9:47pm UTC](https://discuss.elastic.co/t/logstash-file-output-truncate-on-startup/190616/3 "2019-08-12T21:47:43Z")

</div>

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