# Gracefully stop logstash

**URL:** <https://discuss.elastic.co/t/gracefully-stop-logstash/61569>\
**Category:** Logstash\
**Created:** [September 27, 2016, 7:56am UTC](https://discuss.elastic.co/t/gracefully-stop-logstash/61569 "2016-09-27T07:56:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [September 27, 2016, 7:56am UTC](https://discuss.elastic.co/t/gracefully-stop-logstash/61569/1 "2016-09-27T07:56:38Z")

</div>

I am currently running logstash script in the command prompt.  
..\logstash\bin\logstash -f myconfig.conf

I have an output to two databases. What happens here is that If I were to run it with a static file as input the data will be written to the two DB correctly. If I were to run it with a file that is constantly overwritten as input I will have different row count on the two tables if I were to use CTRL + C to stop the logstash.

How can I shut it down such that it will complete the two write operation to the respective DBs before stopping?

---

<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:36am UTC](https://discuss.elastic.co/t/gracefully-stop-logstash/61569/2 "2017-07-06T04:36:43Z")

</div>

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


