首页 文章

来自Elasticsearch错误的Logstash输入

提问于
浏览
3

我正在使用Logstash 1.5.4和Elasticsearch 1.7.1

以下是我的Logstash配置文件:

input {
        elasticsearch {
                host => localhost
        }
}


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

当我没有为Elasticsearch输入包含'host'选项时,这可以正常工作 . 但是,一旦我添加它,它会给我以下错误并关闭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.

现在我知道使用Host是可选的,但我需要它 . 如果我以后想要来自其他localhost的主机的Elasticsearch输入怎么办?

1 回答

  • 6

    elasticsearch 输入中,要使用的正确参数名称是hosts而不是 host .

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

    所以 host 实际上是一个文档错误 . elasticsearch input plugin的Ruby源也讲述了同样的故事 .

相关问题