# How to stop logstash automatically after some time

**URL:** <https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549>\
**Category:** Logstash\
**Created:** [September 14, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549 "2017-09-14T13:52:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishnudivakar31](https://avatars.discourse-cdn.com/v4/letter/v/58f4c7/32.png) [@vishnudivakar31](https://discuss.elastic.co/u/vishnudivakar31)\
**Post date:** [September 14, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549/1 "2017-09-14T13:52:28Z")

</div>

I am running logstash -f \<file.conf\> . I want this to be stopped automatically after 5 mins.

---

<div class="post-metadata">

**Author:** ![Benoit\_Martin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benoit_martin/32/21235_2.png) [@Benoit\_Martin](https://discuss.elastic.co/u/Benoit_Martin)\
**Post date:** [September 14, 2017, 1:55pm UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549/2 "2017-09-14T13:55:34Z")

</div>

Use crontab.

---

<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:** [September 14, 2017, 4:09pm UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549/3 "2017-09-14T16:09:15Z")

</div>

Doesn't sound like a good idea, but here's some rope:

> <https://stackoverflow.com/questions/10224939/how-to-run-a-process-with-a-timeout-in-bash/10225072#10225072>

---

<div class="post-metadata">

**Author:** ![vishnudivakar31](https://avatars.discourse-cdn.com/v4/letter/v/58f4c7/32.png) [@vishnudivakar31](https://discuss.elastic.co/u/vishnudivakar31)\
**Post date:** [September 15, 2017, 4:32am UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549/4 "2017-09-15T04:32:06Z")

</div>

[Hi.Is](http://Hi.Is) there not tag which is supported by logstash to do the same.

---

<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:** [September 15, 2017, 6:06am UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549/5 "2017-09-15T06:06:53Z")

</div>

> Is there not tag which is supported by logstash to do the same.

No.

---

<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 13, 2017, 6:06am UTC](https://discuss.elastic.co/t/how-to-stop-logstash-automatically-after-some-time/100549/6 "2017-10-13T06:06:55Z")

</div>

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