# Stop logstash when finish import

**URL:** <https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969>\
**Category:** Logstash\
**Created:** [December 15, 2017, 11:38am UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969 "2017-12-15T11:38:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [December 15, 2017, 11:38am UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969/1 "2017-12-15T11:38:43Z")

</div>

Hi guys,

I know this topic has already been answered but I wanted to know if with these new release is there any news about this?

If not, can anyone give an example of how to stop logstash with stdin or similar, automatically? I still didn't got it.

Thank you very much,  
Afonso

---

<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:** [December 15, 2017, 12:16pm UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969/2 "2017-12-15T12:16:55Z")

</div>

> I know this topic has already been answered but I wanted to know if with these new release is there any news about this?

Presumably any such changes would be documented in the release notes.

> If not, can anyone give an example of how to stop logstash with stdin or similar, automatically? I still didn't got it.

What part is unclear? When the stdin input has hit the end of the file senses that the other end of the pipe has closed it'll shut Logstash down.

---

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [December 15, 2017, 12:45pm UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969/3 "2017-12-15T12:45:28Z")

</div>

Thank you Magnus for the answer.

The thing is, where should I put stdin?

My config file is like this:

input {  
file{  
path =\> "D:\Users\afonso.ribeiro\Desktop\dados\_enterprise.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "dev/null"  
codec =\> plain { charset =\> "Windows-1252" }  
}  
}

Should I delete this? And put stdin reading the file?

---

<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:** [December 15, 2017, 12:56pm UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969/4 "2017-12-15T12:56:57Z")

</div>

Yes, replace the file input with a stdin input and pipe the input file to the Logstash process.

---

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [December 15, 2017, 1:11pm UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969/5 "2017-12-15T13:11:16Z")

</div>

Ok. Thank you very much for the help.

I will try to find some example to base on.

Thanks very much again.

Best regards,  
Afonso Ribeiro

---

<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:** [January 12, 2018, 1:11pm UTC](https://discuss.elastic.co/t/stop-logstash-when-finish-import/111969/6 "2018-01-12T13:11:45Z")

</div>

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