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?

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, that was it. Why isn't this mentioned in the doc's very first example! elastic.co/guide/en/logstash/current/…
Documentation bug, I guess ;)
To note, in output it should be "host" only, not "hosts" for Logstash 1.5. elastic.co/guide/en/logstash/1.5/configuration.html
In the elasticsearch input, it's hosts no matter which version. However, in the elasticsearch output, it was host before Logstash 2.0 and then the property name has been standardized to hosts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.