# Problem with Logstash 2.4 with elasticsearch output

**URL:** <https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969>\
**Category:** Logstash\
**Created:** [September 7, 2016, 10:25am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969 "2016-09-07T10:25:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kissaki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kissaki/32/12437_2.png) [@Kissaki](https://discuss.elastic.co/u/Kissaki)\
**Post date:** [September 7, 2016, 10:25am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/1 "2016-09-07T10:25:15Z")

</div>

Hey guys,

I'm just getting started with the ELK stack and have some problems testing Logstash with Elasticsearch.

I run a fresh fedora 24 installation and already installed Elasticsearch 2.4 on it. The curl test on localhost looks good.  
Now I installed Logstash 2.4 through dnf.  
I used [https://packages.elastic.co/logstash/2.4/centos](https://packages.elastic.co/logstash/2.4/centos) for the repo.

The first test worked:

> bin/logstash -e 'input { stdin { } } output { stdout {} }'

The test with codec =\> rubydebug worked as well.

But when I'm trying to run it with elasticsearch

> bin/logstash -e 'input { stdin { } } output { elasticsearch { host = localhost } }'

I get the following error message:

> fetched an invalid config {:config=\>"input { stdin { } } output { elasticsearch { host = localhost } }", :reason=\>"Expected one of #, =\> at line 1, column 51 (byte 51) after output { elasticsearch { host ", :level=\>:error}

When I run tail on the /var/log/logstash/logstash.log I can see the following message

> :timestamp=\>"2016-09-07T12:05:34.408000+0200", :message=\>"No config files found: /etc/logstash/conf.d/\*\nCan you make sure this path is a logstash config file?", :level=\>:error

Which is true, /etc/logstash/conf.d has no configuration files at all and there is no configuration folder in /opt/logstash either.

Am I supposed to create the configuration files my self or am I doing something wrong here? Any ideas?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 7, 2016, 10:29am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/2 "2016-09-07T10:29:00Z")

</div>

> [@Kissaki](#):
>
> host = localhost

Should be `host => "localhost"`.

---

<div class="post-metadata">

**Author:** ![Kissaki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kissaki/32/12437_2.png) [@Kissaki](https://discuss.elastic.co/u/Kissaki)\
**Post date:** [September 7, 2016, 10:34am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/3 "2016-09-07T10:34:54Z")

</div>

I tried this too.

The version with only "host = localhost" is out of the book I'm currently using.

with =\> the error message looks like this:

> Settings: Default pipeline workers: 4  
> Pipeline aborted due to error {:exception=\>"LogStash::ConfigurationError", :backtrace=\>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/config/mixin.rb:88:in `config_init'", "org/jruby/RubyHash.java:1342:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/config/mixin.rb:72:in `config_init'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/outputs/base.rb:79:in `initialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/output\_delegator.rb:74:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:181:in `start\_workers'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:181:in `start\_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in `start\_pipeline'"], :level=\>:error}  
> stopping pipeline {:id=\>"main"}

---

<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 7, 2016, 10:46am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/4 "2016-09-07T10:46:12Z")

</div>

> Should be `host => "localhost"`.

Actually, either is fine. However, as of Logstash 2.0 it's `hosts` and not `host`.

---

<div class="post-metadata">

**Author:** ![Kissaki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kissaki/32/12437_2.png) [@Kissaki](https://discuss.elastic.co/u/Kissaki)\
**Post date:** [September 7, 2016, 10:58am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/5 "2016-09-07T10:58:22Z")

</div>

That worked, I'm only on page 15 and already that's the second function that doesn't even work any more, maybe I should stick to the online reference.

Anyway thanks for the help guys 🙂

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 7, 2016, 9:18pm UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/6 "2016-09-07T21:18:32Z")

</div>

> [@Kissaki](#):
>
> The version with only "host = localhost" is out of the book I'm currently using.

Then it's wrong. You should always cross check with the docs 🙂

---

<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, 4:39am UTC](https://discuss.elastic.co/t/problem-with-logstash-2-4-with-elasticsearch-output/59969/7 "2017-07-06T04:39:25Z")

</div>


