2016-11-17 67 views
0

我使用Logstash(2.4.0)输出日志到Elasticsearch(2.3.3)服务器。Logstash输出日志到Elasticsearch服务器ConfigurationError

推出Logstash之前,我写一个配置文件logstash-2.4.0/conf

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

然后运行./bin/logstash -f conf/logstash.conf,如下错误信息: enter image description here 如何解决售后服务这个问题?

+0

尝试删除'filter'标准,因为它没有在上面使用,'elasticsearch'中的'host'应该是'hosts'。 – Kulasangar

回答

1

你可以看起来像下面的配置,没有filter。你错过了主机中的“s”和应该在localhost之前和之后的双引号。

input { 
     stdin {} 
} 

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

你可以检查从hereelasticsearch插件确切的概要。

+0

如果ES是本地主机,则不需要添加此配置选项,因为主机的默认值为172.0.0.1,不是? – baudsp

+0

@baudsp是的,您可以拥有它,也可以不提及它。 – Kulasangar

+0

谢谢,我有疑问。 – baudsp

0

根据@Kulasangar的回答,它运作良好,在CentOS 6.5和Ubuntu 16.04,但对我MAC.I改变了同样的错误,以root用户:

sudo su 

然后我重新启动logstash和elasticsearch,一切都好。