Reputation: 14800
I want to parse a simple logfile with logstash and post the results to elastic search. I've configured logstash according to the log stash documentation.
But Logstash reports this error:
Attempted to send a bulk request to Elasticsearch configured at '["http://localhost:9200/"]',
but Elasticsearch appears to be unreachable or down!
{:client_config=>{:hosts=>["http://localhost:9200/"], :ssl=>nil,
:transport_options=>{:socket_timeout=>0, :request_timeout=>0, :proxy=>nil,
:ssl=>{}}, :transport_class=>Elasticsearch::Transport::Transport::HTTP::Manticore,
:logger=>nil, :tracer=>nil, :reload_connections=>false, :retry_on_failure=>false,
:reload_on_failure=>false, :randomize_hosts=>false}, :error_message=>"Connection refused",
:level=>:error}
My configuration looks like this:
input { stdin{} }
filter {
grok {
match => { "message" => "%{NOTSPACE:demo}"}
}
}
output {
elasticsearch { hosts => "localhost:9200"}
}
Of course elastic search is available when calling http://localhost:9200/
Versions: logstash-2.0.0, elasticsearch-2.0.0 OSX
I've found a thread with a similar issue. But this seems to be a bug in an older logstash version.
Upvotes: 1
Views: 2055
Reputation: 14800
I changed localhost to 127.0.0.1
This works:
output {
elasticsearch { hosts => "127.0.0.1:9200"}
}
Upvotes: 1