Unable to map the logstash with ElasticSearch on linux
I just run the below command and it shows all the running images on docker
sudo docker ps
Output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e14ace6bd419 a962b6541416 "/bin/bash /usr/loca…" 23 hours ago Up 22 hours 0.0.0.0:5601->5601/tcp trusting_chatterjee
00e6822bb991 28259852697e "/usr/local/bin/dock…" 23 hours ago Up 23 hours 9200/tcp, 9300/tcp friendly_roentgen
I just want to link the logstash into elastic search and tried to run the below command
Command:
sudo docker run -d --rm -it -v /home/sabharanikumar/logstash.conf e95781358676
Output:
989e2a8f4d9fd972c4f2102d726a68877c989b546800899abbb8c382fb62f04c
logstash.conf:
input
{
stdin{}
}
output
{
elasticsearch{ hosts => ["localhost:9200"] }
}
Logstash Log:
[2019-08-23T09:40:53,833][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://logstash_system:xxxxxx@elasticsearch:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}
I ran the sudo docker ps but the logstash is being listed.
Is there anything I missed it? Is there anywhere I need to change the host value?
sudo docker ps -a
and then you will see your container with an Exit status. Rundocker logs <container_name>
and post the result if you still need help with figuring it out, but most probably the log will tell you exactly what the problem is. – Mihaifriendly_roentgen
instead. Regarding the container names, I suggest you give them names when you start them instead of letting docker choose another random name each time you start your containers. – Mihai