# How to detect when the input data is finished

**URL:** <https://discuss.elastic.co/t/how-to-detect-when-the-input-data-is-finished/54945>\
**Category:** Logstash\
**Created:** [July 7, 2016, 12:48pm UTC](https://discuss.elastic.co/t/how-to-detect-when-the-input-data-is-finished/54945 "2016-07-07T12:48:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Ryan](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@Ben\_Ryan](https://discuss.elastic.co/u/Ben_Ryan)\
**Post date:** [July 7, 2016, 12:48pm UTC](https://discuss.elastic.co/t/how-to-detect-when-the-input-data-is-finished/54945/1 "2016-07-07T12:48:43Z")

</div>

I am using Logstash from the cmd line with file input and using cat to push new data to the input file. I need to be able to detect when the input is finished so that I can kill the Logstash instance.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 7, 2016, 10:50pm UTC](https://discuss.elastic.co/t/how-to-detect-when-the-input-data-is-finished/54945/2 "2016-07-07T22:50:00Z")

</div>

If you are using cat then it should shutdown as soon as it has processed.

---

<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 8, 2016, 5:26am UTC](https://discuss.elastic.co/t/how-to-detect-when-the-input-data-is-finished/54945/3 "2016-07-08T05:26:40Z")

</div>

If you're using the stdin input Mark's answer applies. For monitoring the progress of a file input see [http://stackoverflow.com/a/33146636/414355](http://stackoverflow.com/a/33146636/414355).

---

<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, 4:48am UTC](https://discuss.elastic.co/t/how-to-detect-when-the-input-data-is-finished/54945/4 "2017-07-06T04:48:59Z")

</div>

Closed on July 6, 2017, 4:48am UTC


