# Delete file after read

**URL:** <https://discuss.elastic.co/t/delete-file-after-read/26656>\
**Category:** Logstash\
**Created:** [July 31, 2015, 5:56pm UTC](https://discuss.elastic.co/t/delete-file-after-read/26656 "2015-07-31T17:56:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Win\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/win_wang/32/674_2.png) [@Win\_Wang](https://discuss.elastic.co/u/Win_Wang)\
**Post date:** [July 31, 2015, 5:56pm UTC](https://discuss.elastic.co/t/delete-file-after-read/26656/1 "2015-07-31T17:56:39Z")

</div>

I want to delete a file once all its lines have been read. I'm using file input + split filter so I can't just delete at the end of my filters.

---

<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:** [July 31, 2015, 5:58pm UTC](https://discuss.elastic.co/t/delete-file-after-read/26656/2 "2015-07-31T17:58:58Z")

</div>

This question has the same answer as this one:

> [@Stop Logstash when it has finished to read a csv file](https://discuss.elastic.co/t/stop-logstash-when-it-has-finished-to-read-a-csv-file/26632):
>
> Hi everybody, I'm using Logstash 1.5.3 and its input "file" in order to index a csv file to Elasticsearch. I want to execute logstash and when it has finished to read my file I want to properly stop Logstash. How can I do that? Thanks in advance for your help.

---

<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:** [July 6, 2017, 5:33am UTC](https://discuss.elastic.co/t/delete-file-after-read/26656/3 "2017-07-06T05:33:12Z")

</div>


