# Close output file after writing

**URL:** <https://discuss.elastic.co/t/close-output-file-after-writing/105870>\
**Category:** Logstash\
**Created:** [October 31, 2017, 10:52am UTC](https://discuss.elastic.co/t/close-output-file-after-writing/105870 "2017-10-31T10:52:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdra](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cdra](https://discuss.elastic.co/u/cdra)\
**Post date:** [October 31, 2017, 10:52am UTC](https://discuss.elastic.co/t/close-output-file-after-writing/105870/1 "2017-10-31T10:52:08Z")

</div>

When I use output file /CSV file, I need to close it after event is writtten

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 31, 2017, 10:57am UTC](https://discuss.elastic.co/t/close-output-file-after-writing/105870/2 "2017-10-31T10:57:55Z")

</div>

You want to close and reopen the output file for each event? That's not supported by the file output but you should be able to use the exec output to e.g. run a tee command that appends to the output file.

---

<div class="post-metadata">

**Author:** ![cdra](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cdra](https://discuss.elastic.co/u/cdra)\
**Post date:** [October 31, 2017, 11:29am UTC](https://discuss.elastic.co/t/close-output-file-after-writing/105870/3 "2017-10-31T11:29:48Z")

</div>

> [@magnusbaeck](#):
>
> You want to close and reopen the output file for each event? That's not supported by the file output but you should be able to use the exec output to e.g. run a tee command that appends to the output

We use versión windosws, I can't see exec output plugin on default installation. I've installed now....I'll check if it's a solution

---

<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:** [November 28, 2017, 11:30am UTC](https://discuss.elastic.co/t/close-output-file-after-writing/105870/4 "2017-11-28T11:30:06Z")

</div>

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