# Logstash can't connect to Elasticsearch when install X-Pack

**URL:** <https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827>\
**Category:** Logstash\
**Created:** [July 5, 2017, 3:21am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827 "2017-07-05T03:21:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonnguyenit](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonnguyenit](https://discuss.elastic.co/u/sonnguyenit)\
**Post date:** [July 5, 2017, 3:21am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827/1 "2017-07-05T03:21:39Z")

</div>

When i install x-pack plugin for ES, kibana, and logstash.  
Kibana work well.  
But Logstash can't connect to the ES. (ES install in a remote server).  
Before install x-pack, logstash work well.  
My logstash output configuration:

```
elasticsearch {
        hosts => ["ip_of_es_server:9200"]
        user: "myuser"
        password: "mypasssword"
    }

```

The log errors here:

`LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://myuser:xxxxxx@localhost:9200/][Manticore::SocketException] Connection refused: connect"}`

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 5, 2017, 3:23am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827/2 "2017-07-05T03:23:28Z")

</div>

Can you curl the Elasticsearch host from the Logstash one using those details?

---

<div class="post-metadata">

**Author:** ![sonnguyenit](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonnguyenit](https://discuss.elastic.co/u/sonnguyenit)\
**Post date:** [July 5, 2017, 3:25am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827/3 "2017-07-05T03:25:31Z")

</div>

It's here:

```auto
    {
      "name" : "5gqJdvp",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "r8qPXLeXSuOwWnOIj7x-Jw",
      "version" : {
        "number" : "5.4.3",
        "build_hash" : "eed30a8",
        "build_date" : "2017-06-22T00:34:03.743Z",
        "build_snapshot" : false,
        "lucene_version" : "6.5.1"
      },
      "tagline" : "You Know, for Search"
    }

```

The error log above appear when i start logstash.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 5, 2017, 3:27am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827/4 "2017-07-05T03:27:32Z")

</div>

Is that config above exactly what you have in Logstash? Because it's not syntactically correct if it is.

---

<div class="post-metadata">

**Author:** ![sonnguyenit](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonnguyenit](https://discuss.elastic.co/u/sonnguyenit)\
**Post date:** [July 5, 2017, 3:30am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827/5 "2017-07-05T03:30:16Z")

</div>

Here is all my pipeline conf file that i use to run logstash:

```auto
# The # character at the beginning of a line indicates a comment. Use
# comments to describe your configuration.
input {
	beats {
        port => "5043"
    }
}
# The filter part of this file is commented out to indicate that it is
# optional.
filter {
  json {
    source => "message"
	remove_field => ["message","input_type","source","type"]
  }
  date {
    match => ["ActionDate", "yyyy-MM-dd HH:mm:ss"]
  }
}
output {
     elasticsearch {
        hosts => ["192.168.2.61:9200"]
	user => "myuser"
	password => "mypass"
        flush_size => 10000
    }
}

```

---

<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 2, 2017, 3:30am UTC](https://discuss.elastic.co/t/logstash-cant-connect-to-elasticsearch-when-install-x-pack/91827/6 "2017-08-02T03:30:33Z")

</div>

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