Problem with Logstash 2.4 with elasticsearch output

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 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?

Should be host => "localhost".

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:ineach'", "/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:ininitialize'", "/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:instart_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:instart_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:instart_pipeline'"], :level=>:error}
stopping pipeline {:id=>"main"}

Should be host => "localhost".

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

1 Like

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 :slight_smile:

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