# Logstash stops running after running for few seconds

**URL:** <https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765>\
**Category:** Logstash\
**Created:** [August 3, 2017, 6:48pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765 "2017-08-03T18:48:31Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 3, 2017, 6:48pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/1 "2017-08-03T18:48:31Z")

</div>

Hi,

My logstash stops running after 4 seconds of starting it, i get this output for systemctl status logstash -l

logstash.service - logstash  
Loaded: loaded (/etc/systemd/system/logstash.service; disabled; vendor preset: disabled)  
Active: active (running) since Thu 2017-08-03 18:46:53 UTC; 302ms ago  
Main PID: 7521 (java)  
CGroup: /system.slice/logstash.service  
ââ7521 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx4g -Xms1g -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash

Aug 03 18:46:53 [ip-10-x-x-250.domain.com](http://ip-10-x-x-250.domain.com) systemd[1]: Started logstash.  
Aug 03 18:46:53 [ip-10-x-x-250.domain.com](http://ip-10-x-x-250.domain.com) systemd[1]: Starting logstash...

There is no log file created in /var/log/logstash.

Any help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 4, 2017, 2:30am UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/2 "2017-08-04T02:30:01Z")

</div>

Although when i do a test against the config file, it pases the test and also when i start logstash using the command

bin/logstash -f /path/to/config/file , it gives the desired output, but it doesnt work when i try to start it as systemctl start logstash

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [August 4, 2017, 5:34am UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/3 "2017-08-04T05:34:22Z")

</div>

hope when you are running it as user you are using 'sudo'

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 4, 2017, 1:46pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/4 "2017-08-04T13:46:22Z")

</div>

I am a root on the server.

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 4, 2017, 1:57pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/5 "2017-08-04T13:57:32Z")

</div>

Can anybody help me in resolving this issue? It has been down for sometime now.

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [August 6, 2017, 3:58am UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/6 "2017-08-06T03:58:27Z")

</div>

when you start it as service logstash start did you check if its running or not ?  
start the logstash and show me the output of  
$ ps aux | grep logstash

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 6, 2017, 8:16pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/7 "2017-08-06T20:16:37Z")

</div>

everytime i run this command, i can see a new PID which means that it is trying to restart logstash every few seconds and is failing, finally after few unsuccessful attempts it fails forever and never restarts untill i run the start command again.

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [August 7, 2017, 12:29pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/8 "2017-08-07T12:29:43Z")

</div>

did you check logstash logs in /var/log/logstash?

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 7, 2017, 2:21pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/9 "2017-08-07T14:21:44Z")

</div>

> [@Vishal\_Sharma1](#):
>
> /var/log/logstash

Nothing logged to related to the startup failure, but here is the log i see 🙂  
[2017-08-04T15:22:13,694][INFO][logstash.pipeline] Starting pipeline {"id"=\>"main", "pipeline.workers"=\>2, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>250}  
[2017-08-04T15:38:42,520][INFO][logstash.pipeline] Pipeline main started  
[2017-08-04T15:38:42,531][WARN][logstash.runner] SIGHUP received.  
[2017-08-04T15:38:42,545][WARN][logstash.runner] SIGTERM received. Shutting down the agent.  
[2017-08-04T15:38:42,558][ERROR][logstash.inputs.metrics] Failed to create monitoring event {:message=\>"For path: http\_address", :error=\>"LogStash::Instrument::MetricStore::MetricNotFound"}  
[2017-08-04T15:38:42,589][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2017-08-04T15:38:43,565][WARN][logstash.agent] stopping pipeline {:id=\>".monitoring-logstash"}  
[2017-08-04T15:38:45,517][WARN][logstash.agent] stopping pipeline {:id=\>"main"}

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [August 8, 2017, 2:41pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/10 "2017-08-08T14:41:04Z")

</div>

run it using strace and save the output to a file and share it with us.

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 8, 2017, 2:41pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/11 "2017-08-08T14:41:40Z")

</div>

whats the command to run it using strace?

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [August 8, 2017, 2:52pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/12 "2017-08-08T14:52:07Z")

</div>

before that did you try to run it manually from /usr/share/logstash ?  
$ cd /usr/share/logstash  
$ bin/logstash -f /etc/logstash.d/conf/yourfile.conf

and see if it runs properly

---

<div class="post-metadata">

**Author:** ![shroh](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shroh](https://discuss.elastic.co/u/shroh)\
**Post date:** [August 8, 2017, 4:26pm UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/13 "2017-08-08T16:26:56Z")

</div>

Yes i ran it manually using this command, and i am still running it using just one config file. It works like a champ. But not with systemctl start logstash

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma1/32/20207_2.png) [@Vishal\_Sharma1](https://discuss.elastic.co/u/Vishal_Sharma1)\
**Post date:** [August 9, 2017, 11:06am UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/14 "2017-08-09T11:06:16Z")

</div>

ok so start it as service again and show me the output of  
$systemctl status logstash

---

<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:** [September 6, 2017, 11:06am UTC](https://discuss.elastic.co/t/logstash-stops-running-after-running-for-few-seconds/95765/15 "2017-09-06T11:06:29Z")

</div>

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