# How to stop main pipeline anter data is inserted in elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257>\
**Category:** Logstash\
**Created:** [October 25, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257 "2017-10-25T13:52:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![virahul29](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@virahul29](https://discuss.elastic.co/u/virahul29)\
**Post date:** [October 25, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/1 "2017-10-25T13:52:06Z")

</div>

hi

How can i stop the main pipeline from the logstash script after data get inserted from the text file to the elastic index

so that i can again run the logstash script

---

<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 25, 2017, 2:01pm UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/2 "2017-10-25T14:01:47Z")

</div>

> How can i stop the main pipeline from the logstash script after data get inserted from the text file to the elastic index

There's nothing built in for this (unless you use the stdin input) but see [Logstash parsing progress bar - Stack Overflow](https://stackoverflow.com/a/33146636/414355).

> so that i can again run the logstash script

Why do you want to repeatedly stop and restart Logstash? What's your use case?

---

<div class="post-metadata">

**Author:** ![virahul29](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@virahul29](https://discuss.elastic.co/u/virahul29)\
**Post date:** [October 25, 2017, 2:10pm UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/3 "2017-10-25T14:10:37Z")

</div>

yes according to my buisness requirement

so i can insert data in elasticsearch close it  
then delete text file  
again for new text file  
then again start the logstash script

---

<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 25, 2017, 2:35pm UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/4 "2017-10-25T14:35:25Z")

</div>

I find it hard to believe that the business requirements really state that you need to stop and restart Logstash for each file.

What are the real requirements? That the files have to be processed in a particular order?

---

<div class="post-metadata">

**Author:** ![virahul29](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@virahul29](https://discuss.elastic.co/u/virahul29)\
**Post date:** [October 26, 2017, 8:30am UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/5 "2017-10-26T08:30:10Z")

</div>

can we use close\_older tag to terminate the script in input

---

<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 26, 2017, 8:40am UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/6 "2017-10-26T08:40:46Z")

</div>

Feel free to use that option (it's harmless) but it has nothing to do with the questions you're asking.

---

<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 23, 2017, 8:40am UTC](https://discuss.elastic.co/t/how-to-stop-main-pipeline-anter-data-is-inserted-in-elasticsearch/105257/7 "2017-11-23T08:40:50Z")

</div>

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