3

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?

4

1 回答 1

6

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.

于 2015-08-25T09:58:04.523 回答