# How to make Logstash.bat not wait

**URL:** <https://discuss.elastic.co/t/how-to-make-logstash-bat-not-wait/41230>\
**Category:** Logstash\
**Created:** [February 8, 2016, 10:28pm UTC](https://discuss.elastic.co/t/how-to-make-logstash-bat-not-wait/41230 "2016-02-08T22:28:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddipatla](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@maddipatla](https://discuss.elastic.co/u/maddipatla)\
**Post date:** [February 8, 2016, 10:28pm UTC](https://discuss.elastic.co/t/how-to-make-logstash-bat-not-wait/41230/1 "2016-02-08T22:28:39Z")

</div>

I want to trigger logstash.bat programmatically from C# code and i do not want the process to wait. How can i make the logstash.bat agent -f xyz to exit.

I tried specifying discover\_interval=\>0 and stat\_interval=\>0 in the file input plugin. It did not help.

-Madhu

---

<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:** [February 9, 2016, 9:05am UTC](https://discuss.elastic.co/t/how-to-make-logstash-bat-not-wait/41230/2 "2016-02-09T09:05:44Z")

</div>

There's no simple way of doing this. The links below provide further reading. I know you're not asking about log file deletion but the fundamental problem is that same, namely that the file input doesn't have a concept of "done".

> <https://stackoverflow.com/questions/30759951/delete-logs-after-consumption-logstash>

> <https://github.com/logstash-plugins/logstash-input-file/issues/52>

---

<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, 5:12am UTC](https://discuss.elastic.co/t/how-to-make-logstash-bat-not-wait/41230/3 "2017-07-06T05:12:35Z")

</div>

Closed on July 6, 2017, 5:12am UTC


