# Logstash failling to make connection to ElasticSearch

**URL:** <https://discuss.elastic.co/t/logstash-failling-to-make-connection-to-elasticsearch/339731>\
**Category:** Logstash\
**Created:** [July 31, 2023, 8:18pm UTC](https://discuss.elastic.co/t/logstash-failling-to-make-connection-to-elasticsearch/339731 "2023-07-31T20:18:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilyass\_Taybi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ilyass_taybi/32/119375_2.png) [@Ilyass\_Taybi](https://discuss.elastic.co/u/Ilyass_Taybi)\
**Post date:** [July 31, 2023, 8:18pm UTC](https://discuss.elastic.co/t/logstash-failling-to-make-connection-to-elasticsearch/339731/1 "2023-07-31T20:18:28Z")

</div>

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/](http://localhost:9200/)", :exception=\>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=\>"Elasticsearch Unreachable: [[http://localhost:9200/](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/](http://localhost:9200/)", :exception=\>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=\>"Elasticsearch Unreachable: [[http://localhost:9200/](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/](http://localhost:9200/)", :exception=\>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=\>"Elasticsearch Unreachable: [[http://localhost:9200/](http://localhost:9200/)][Manticore::SocketException] Network is unreachable"}.

Please help me, Thanks.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 31, 2023, 11:41pm UTC](https://discuss.elastic.co/t/logstash-failling-to-make-connection-to-elasticsearch/339731/2 "2023-07-31T23:41:26Z")

</div>

> [@Ilyass\_Taybi](#):
>
> "Elasticsearch Unreachable: [[http://localhost:9200/](http://localhost:9200/)][Manticore::SocketException] Network is unreachable"

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

```auto
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>

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 31, 2023, 11:53pm UTC](https://discuss.elastic.co/t/logstash-failling-to-make-connection-to-elasticsearch/339731/4 "2023-07-31T23:53:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 29, 2023, 12:00am UTC](https://discuss.elastic.co/t/logstash-failling-to-make-connection-to-elasticsearch/339731/6 "2023-08-29T00:00:54Z")

</div>

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