简体   繁体   中英

Logstash Input from Elasticsearch Error

I'm using Logstash 1.5.4 and Elasticsearch 1.7.1

The following is my Logstash configuration file:

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. However, once I add it, it gives me the following error and shuts Logstash off:

←[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. What if later on I wanted an Elasticsearch input from a host other that localhost?

In the elasticsearch input, the correct parameter name to use is hosts not host .

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

So host is actually a documentation bug. The Ruby source for the elasticsearch input plugin also tells the same story.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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