简体   繁体   English

来自Elasticsearch错误的Logstash输入

[英]Logstash Input from Elasticsearch Error

I'm using Logstash 1.5.4 and Elasticsearch 1.7.1 我正在使用Logstash 1.5.4和Elasticsearch 1.7.1

The following is my Logstash configuration file: 以下是我的Logstash配置文件:

input {
        elasticsearch {
                host => localhost
        }
}


output {
        elasticsearch {
                host => localhost
        }
        stdout {
                codec => rubydebug
        }
}

This works fine when I don't include the 'host' option for Elasticsearch input. 当我没有为Elasticsearch输入包含'host'选项时,这可以正常工作。 However, once I add it, it gives me the following error and shuts Logstash off: 但是,一旦我添加它,它会给我以下错误并关闭Logstash:

←[31mUnknown setting 'host' for elasticsearch {:level=>:error}←[0m
Error: Something is wrong with your configuration.
You may be interested in the '--configtest' flag which you can
use to validate logstash's configuration before you choose
to restart a running system.

Now I know that using Host is optional, but I need it. 现在我知道使用Host是可选的,但我需要它。 What if later on I wanted an Elasticsearch input from a host other that localhost? 如果我以后想要来自其他localhost的主机的Elasticsearch输入怎么办?

In the elasticsearch input, the correct parameter name to use is hosts not host . elasticsearch输入中,要使用的正确参数名称是hosts而不是host

input {
        elasticsearch {
                hosts => "localhost"
        }
}
...

So host is actually a documentation bug. 所以host实际上是一个文档错误。 The Ruby source for the elasticsearch input plugin also tells the same story. elasticsearch输入插件的Ruby源也讲述了同样的故事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM