0

I use Logstash(2.4.0) output logs to Elasticsearch(2.3.3) server.

Before launch Logstash,I write a configuration file logstash-2.4.0/conf:

input { 
    stdin {} 
} 
filter{
}           
output {            
    elasticsearch { host => localhost }
    stdout { codec => rubydebug }
}

then run ./bin/logstash -f conf/logstash.conf,the error info as below: enter image description here how to slove this problem?

1
  • Try removing the filter criteria, since it's not used in the above and the host within elasticsearch should be hosts. Commented Nov 17, 2016 at 10:10

2 Answers 2

1

You could have the config look like below, without having the filter. You're missing out the "s" in hosts and the double quotes which should go before and after localhost.

input {
       stdin {}
}

output {
     elasticsearch { hosts => "localhost" }
     stdout { codec => rubydebug }
}

You could check the exact synopsis for the elasticsearch plugin from here.

Sign up to request clarification or add additional context in comments.

8 Comments

If the ES is localhost, it should not need to add this configuration option, since the default for hosts is 172.0.0.1, no?
@baudsp Yes that's right, you can either have it or leave it without mentioning it.
@baudsp no problem, anytime :)
172.0.0.1 or 127.0.0.1?
@YaoPan it's 127.0.0.1
|
0

according to @Kulasangar' answer,it works well on CentOS 6.5 and Ubuntu 16.04,but has the same error on my MAC.I change to root user:

sudo su

then I relaunch logstash and elasticsearch,everything is well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.