I am running Elk stack on docker. All services starts perfectly fine. However I am getting connection refused in logstash logs.
Here is my conf file for logstash:
input {
file {
path => "/tmp/*_log"
start_position => "beginning"
}
elasticsearch {
user => logstash_internal
password => logstash
}
}
output {
elasticsearch {
user => logstash_internal
password => logstash
hosts => ["elasticsearch:9200"]
}
stdout { codec => rubydebug }
}
Sample log:
[2017-11-07T00:35:28,957][INFO ][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//elasticsearch:9200"]}
[2017-11-07T00:35:28,959][INFO ][logstash.pipeline ] Starting pipeline {"id"=>"main", "pipeline.workers"=>2, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>250}
[2017-11-07T00:35:29,216][INFO ][logstash.pipeline ] Pipeline main started
[2017-11-07T00:35:29,279][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Plugin: <LogStash::Inputs::Elasticsearch user=>"logstash_internal", password=><password>, id=>"f266aacba8d15ed350736e5ee472c7da4536f879-2", enable_metric=>true, codec=><LogStash::Codecs::JSON id=>"json_99b755e1-2da1-4e2b-b4e0-f9b41ceeb0fa", enable_metric=>true, charset=>"UTF-8">, index=>"logstash-*", query=>"{ \"sort\": [ \"_doc\" ] }", size=>1000, scroll=>"1m", docinfo=>false, docinfo_target=>"@metadata", docinfo_fields=>["_index", "_type", "_id"], ssl=>false>
Error: Connection refused - Connection refused
[2017-11-07T00:35:29,301][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2017-11-07T00:35:30,284][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Plugin: <LogStash::Inputs::Elasticsearch user=>"logstash_internal", password=><password>, id=>"f266aacba8d15ed350736e5ee472c7da4536f879-2", enable_metric=>true, codec=><LogStash::Codecs::JSON id=>"json_99b755e1-2da1-4e2b-b4e0-f9b41ceeb0fa", enable_metric=>true, charset=>"UTF-8">, index=>"logstash-*", query=>"{ \"sort\": [ \"_doc\" ] }", size=>1000, scroll=>"1m", docinfo=>false, docinfo_target=>"@metadata", docinfo_fields=>["_index", "_type", "_id"], ssl=>false>
I did create the logstash* user and roles following the guidelines listed at https://www.elastic.co/guide/en/x-pack/current/logstash.html
I can also curl to http://user:passwprd@elasticsearch:9200 within the logstash container. So I know it is reachable.
I am not sure where the problem is.