# When elastic X-PACK is enabled logstash can't connect to elasticsearch

**URL:** https://discuss.elastic.co/t/when-elastic-x-pack-is-enabled-logstash-cant-connect-to-elasticsearch/75138
**Category:** Logstash
**Created:** [February 15, 2017, 6:18am UTC](https://discuss.elastic.co/t/when-elastic-x-pack-is-enabled-logstash-cant-connect-to-elasticsearch/75138 "2017-02-15T06:18:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [February 15, 2017, 6:18am UTC](https://discuss.elastic.co/t/when-elastic-x-pack-is-enabled-logstash-cant-connect-to-elasticsearch/75138/1 "2017-02-15T06:18:18Z")

</div>

when elastic X-PACK is enabled how logstash can connect to elastic 9200  
the logstash can't startup when use ./logstash -f logstash.conf  
the confgure file output elasticsearch host xx.xx.xx:9200  
the logstash log output error "401" "Got response code 401 contact elasticsearch at url '[http://xx.xx.xx.xx:9200](http://xx.xx.xx.xx:9200)'"

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [February 15, 2017, 6:44am UTC](https://discuss.elastic.co/t/when-elastic-x-pack-is-enabled-logstash-cant-connect-to-elasticsearch/75138/2 "2017-02-15T06:44:00Z")

</div>

Have you configured Logstash to authenticate to Elasticsearch? The 401 response indicates you haven't, or that you're using the wrong credentials.

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [February 15, 2017, 7:13am UTC](https://discuss.elastic.co/t/when-elastic-x-pack-is-enabled-logstash-cant-connect-to-elasticsearch/75138/3 "2017-02-15T07:13:49Z")

</div>

i find it how to solve it in logstash configure file can add the es user and password  
can cloes it .

---

<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: [March 15, 2017, 7:14am UTC](https://discuss.elastic.co/t/when-elastic-x-pack-is-enabled-logstash-cant-connect-to-elasticsearch/75138/4 "2017-03-15T07:14:06Z")

</div>

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