# Logstash shuts down after a few seconds

**URL:** https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195
**Category:** Logstash
**Created:** [February 27, 2020, 9:35am UTC](https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195 "2020-02-27T09:35:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![PRAV01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prav01/32/47196_2.png) [@PRAV01](https://discuss.elastic.co/u/PRAV01)
#### Post date: [February 27, 2020, 9:35am UTC](https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195/1 "2020-02-27T09:35:39Z")

</div>

Hi, i'm using Logstash 7.6.0 and i am trying to make a function where i read logs on port 3003. to do so i installed the http output plugin and created a file called plugin.conf in /usr/share/logstash/config as so:  
output {  
http {  
url =\> "127.0.0.1:3003"  
http\_method =\> "post"  
}  
}  
and on port 3003 there is gonna be another script listening.  
i start logstash through the command  
**/usr/share/logstash/bin/logstash -f /usr/share/logstash/config/**  
but after 5 seconds logstash suts down with this error:

[ERROR] 2020-02-27 09:10:38.782 [Converge PipelineAction::Create] agent - Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of [\t\r\n], "#", "input", "filter", "output" at line 1, column 1 (byte 1)", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:47:in `compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:55:in `compile\_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:17:in `block in compile_sources'", "org/jruby/RubyArray.java:2580:in `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:14:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:161:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:27:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:36:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:326:in `block in converge\_state'"]}  
[INFO] 2020-02-27 09:10:39.001 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=\>9600}  
[INFO] 2020-02-27 09:10:44.058 [LogStash::Runner] runner - Logstash shut down.

i copied in the config folder all the other config files in /etc/logstash/conf.d also, and tested each of them with  
**/usr/share/logstash/bin/logstash --config.test\_and\_exit -f /usr/share/logstash/config/configfile.conf**  
resulting all of them OK.  
Since it seems an easy configuration, i find weird that logstash shuts down after 5 seconds. If i run logstash throught **service logstash start** the service run normally but doesn't do the job, can anybody help me?

---

<div class="post-metadata">

### Author: ![ahmed\_charafouddine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_charafouddine/32/45129_2.png) [@ahmed\_charafouddine](https://discuss.elastic.co/u/ahmed_charafouddine)
#### Post date: [February 27, 2020, 9:51am UTC](https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195/2 "2020-02-27T09:51:16Z")

</div>

Your logstash configuration file should at least have a block input and another bock output.

---

<div class="post-metadata">

### Author: ![PRAV01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prav01/32/47196_2.png) [@PRAV01](https://discuss.elastic.co/u/PRAV01)
#### Post date: [February 27, 2020, 10:17am UTC](https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195/3 "2020-02-27T10:17:03Z")

</div>

thank you! with this configuration is working, i post it just in case someone else needs it  
input {  
beats {  
port =\> 5044  
}  
http {  
port =\> 5043  
}  
}  
output {  
elasticsearch {  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"  
}  
http {  
url =\> "[http://127.0.0.1:3003](http://127.0.0.1:3003)"  
http\_method =\> "post"  
}  
file {  
path =\> "/home/sysadmin/test.log"  
}  
}

---

<div class="post-metadata">

### Author: ![ahmed\_charafouddine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_charafouddine/32/45129_2.png) [@ahmed\_charafouddine](https://discuss.elastic.co/u/ahmed_charafouddine)
#### Post date: [February 27, 2020, 10:19am UTC](https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195/4 "2020-02-27T10:19:53Z")

</div>

Enjoy ! 😀

---

<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: [March 26, 2020, 10:19am UTC](https://discuss.elastic.co/t/logstash-shuts-down-after-a-few-seconds/221195/5 "2020-03-26T10:19:55Z")

</div>

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