Logstash failling to make connection to ElasticSearch

Hello, i am having troubles with Logstash for a week now.
I do not know why does the error persists. To start Logstash, i use the following command : ./bin/logstash -f /"relative path to the file"/logstash-sample.conf .

The error i am getting in the terminal is as follows :

[2023-07-31T21:05:27,244][INFO ][logstash.outputs.elasticsearch][main] Failed to perform request {:message=>"Network is unreachable", :exception=>Manticore::SocketException, :cause=>#<Java::JavaNet::SocketException: Network is unreachable>}

[2023-07-31T21:05:27,246][WARN ][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://localhost:9200/", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://localhost:9200/][Manticore::SocketException] Network is unreachable"}

[2023-07-31T21:05:34,267][INFO ][logstash.outputs.elasticsearch][main] Failed to perform request {:message=>"Network is unreachable", :exception=>Manticore::SocketException, :cause=>#<Java::JavaNet::SocketException: Network is unreachable>}

[2023-07-31T21:05:34,269][WARN ][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://localhost:9200/", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://localhost:9200/][Manticore::SocketException] Network is unreachable"}

[2023-07-31T21:05:42,913][INFO ][logstash.outputs.elasticsearch][main] Failed to perform request {:message=>"Network is unreachable", :exception=>Manticore::SocketException, :cause=>#<Java::JavaNet::SocketException: Network is unreachable>}

[2023-07-31T21:05:42,915][WARN ][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://localhost:9200/", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [http://localhost:9200/][Manticore::SocketException] Network is unreachable"}.

Please help me, Thanks.

If you run ifconfig -a does the list include a loopback interface? Something like

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>

Can you try changing your URL to http:://127.0.0.1:9200/? That will make sure it resolves to IPV4.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.