# "Do something" when the file is done being read

**URL:** https://discuss.elastic.co/t/do-something-when-the-file-is-done-being-read/66536
**Category:** Logstash
**Created:** [November 18, 2016, 12:12pm UTC](https://discuss.elastic.co/t/do-something-when-the-file-is-done-being-read/66536 "2016-11-18T12:12:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![asac2](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@asac2](https://discuss.elastic.co/u/asac2)
#### Post date: [November 18, 2016, 12:12pm UTC](https://discuss.elastic.co/t/do-something-when-the-file-is-done-being-read/66536/1 "2016-11-18T12:12:58Z")

</div>

I want to call a shellscript, when the logstash is done with sending file to ElasticSearch.

I have tried **"done\_do: '/my\_script.sh'"** but it dint worked for me me.

Any guidance will be appreciated.

Regards  
Aman

---

<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: [November 18, 2016, 12:39pm UTC](https://discuss.elastic.co/t/do-something-when-the-file-is-done-being-read/66536/2 "2016-11-18T12:39:46Z")

</div>

This isn't possible. The file input is meant to continuously monitor the files so it's never done.

What you can do is monitor the sincedb file to see when Logstash's current position is equal to the size of the file.

---

<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: [December 16, 2016, 12:39pm UTC](https://discuss.elastic.co/t/do-something-when-the-file-is-done-being-read/66536/3 "2016-12-16T12:39:58Z")

</div>

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