Yao Pan
Yao Pan

Reputation: 524

Logstash output logs to Elasticsearch server ConfigurationError

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?

Upvotes: 0

Views: 129

Answers (2)

Yao Pan
Yao Pan

Reputation: 524

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.

Upvotes: 0

Kulasangar
Kulasangar

Reputation: 9464

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.

Upvotes: 1

Related Questions