# Logstash 5.0.0 - Need to stop the logstash agent once parsing is completed

**URL:** <https://discuss.elastic.co/t/logstash-5-0-0-need-to-stop-the-logstash-agent-once-parsing-is-completed/65842>\
**Category:** Logstash\
**Created:** [November 11, 2016, 7:47pm UTC](https://discuss.elastic.co/t/logstash-5-0-0-need-to-stop-the-logstash-agent-once-parsing-is-completed/65842 "2016-11-11T19:47:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JMeter\_Dude](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@JMeter\_Dude](https://discuss.elastic.co/u/JMeter_Dude)\
**Post date:** [November 11, 2016, 7:47pm UTC](https://discuss.elastic.co/t/logstash-5-0-0-need-to-stop-the-logstash-agent-once-parsing-is-completed/65842/1 "2016-11-11T19:47:09Z")

</div>

Hi.

I am building a EL as a service for a specific set of users. The logs that I parse are often not real time logs and I would like to stop the logstash agent as soon as all of the logs are parsed.

How do I achieve the stopping of the logstash once the agent has parsed the entire log uploaded by the user.

I did find one blog which did this, but was not really to make sense of it. So posting this question here.

---

<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:** [November 12, 2016, 6:19pm UTC](https://discuss.elastic.co/t/logstash-5-0-0-need-to-stop-the-logstash-agent-once-parsing-is-completed/65842/2 "2016-11-12T18:19:48Z")

</div>

> How do I achieve the stopping of the logstash once the agent has parsed the entire log uploaded by the user.

There's no built-in support for this. You can read the file input's state files, the sincedb files, to figure out Logstash's current position in each file. You can also consider using the stdin input instead of the file input.

> I did find one blog which did this, but was not really to make sense of it.

If you post the URL maybe we can help you make sense of it.

---

<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:** [December 10, 2016, 6:19pm UTC](https://discuss.elastic.co/t/logstash-5-0-0-need-to-stop-the-logstash-agent-once-parsing-is-completed/65842/3 "2016-12-10T18:19:49Z")

</div>

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