# Logstash to exit or stop once the data indexing is completed

**URL:** https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755
**Category:** Logstash
**Created:** [September 25, 2017, 8:19pm UTC](https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755 "2017-09-25T20:19:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![surajbs](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@surajbs](https://discuss.elastic.co/u/surajbs)
#### Post date: [September 25, 2017, 8:19pm UTC](https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755/1 "2017-09-25T20:19:04Z")

</div>

Hi,

I am trying to get a solution for logstash to stop after the data indexing gets completed. Or, logstash should stop reading the file once the job is done (command prompt should get stop and exit).

Please share you opinions and ideas for this.

Thank you.

---

<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: [September 26, 2017, 4:44am UTC](https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755/2 "2017-09-26T04:44:44Z")

</div>

It cannot do this. You will need to invoke it a single time while passing in a file using stdin.

---

<div class="post-metadata">

### Author: ![surajbs](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@surajbs](https://discuss.elastic.co/u/surajbs)
#### Post date: [September 26, 2017, 6:05pm UTC](https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755/3 "2017-09-26T18:05:10Z")

</div>

Thank you for your response.

But does it log somewhere when it finish indexing the data?

---

<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: [September 26, 2017, 10:58pm UTC](https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755/4 "2017-09-26T22:58:22Z")

</div>

No, if you run Logstash it just assumes more data is coming in until you stop it.

---

<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: [October 24, 2017, 10:58pm UTC](https://discuss.elastic.co/t/logstash-to-exit-or-stop-once-the-data-indexing-is-completed/101755/5 "2017-10-24T22:58:23Z")

</div>

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