# Unable to launch logstash and ingest data - Got response code '401' contacting Elasticsearch at URL 'http://localhost:9200/\_xpack'

**URL:** https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522
**Category:** Logstash
**Created:** [June 5, 2018, 5:42am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522 "2018-06-05T05:42:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![soumya\_sahoo](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@soumya\_sahoo](https://discuss.elastic.co/u/soumya_sahoo)
#### Post date: [June 5, 2018, 5:42am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522/1 "2018-06-05T05:42:17Z")

</div>

Hi team,

Let me provide a short background to this - I was able to successfully ingest data to the engine using logstash. It is only after installing x-pack that I run into the following error stack upon passing the following command for ingesting data - logstash -f "sys address of the config file".

[2018-06-05T11:00:06,853][WARN][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=\>"[http://logstash:xxxxxx@localhost:9200/](http://logstash:xxxxxx@localhost:9200/)", :error\_type=\>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=\>"Got response code '401' contacting Elasticsearch at URL '[http://localhost:9200/](http://localhost:9200/)'"}  
Got response code '401' contacting Elasticsearch at URL '[http://localhost:9200/\_xpack](http://localhost:9200/_xpack)'  
[2018-06-05T11:00:06,964][ERROR][logstash.licensechecker.licensemanager] Unable to retrieve license information from license server {:message=\>"Got response code '401' contacting Elasticsearch at URL '[http://localhost:9200/\_xpack](http://localhost:9200/_xpack)'", :class=\>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError"}  
[2018-06-05T11:00:06,969][WARN][logstash.licensechecker.xpackinfo] Nil response from License Server  
[2018-06-05T11:00:07,089][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>".monitoring-logstash", :thread=\>"#\<Thread:0x7c4255e9 run\>"}  
[2018-06-05T11:00:07,196][INFO][logstash.agent] Pipelines running {:count=\>1, :pipelines=\>[".monitoring-logstash"]}  
[2018-06-05T11:00:07,214][ERROR][logstash.inputs.metrics] Monitoring is not available: License information is currently unavailable. Please make sure you have added your production elasticsearch connection info in the xpack.monitoring.elasticsearch settings.  
[2018-06-05T11:00:08,688][INFO][logstash.pipeline] Pipeline has terminated {:pipeline\_id=\>".monitoring-logstash", :thread=\>"#\<Thread:0x7c4255e9 run\>"}

Further, I assume it is some kind of connection/auth issues.

Request you to help me identify the fix.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [June 5, 2018, 6:55am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522/2 "2018-06-05T06:55:49Z")

</div>

Can we have your elasticsearch and logstash yml settings?

---

<div class="post-metadata">

### Author: ![soumya\_sahoo](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@soumya\_sahoo](https://discuss.elastic.co/u/soumya_sahoo)
#### Post date: [June 5, 2018, 8:53am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522/3 "2018-06-05T08:53:21Z")

</div>

Hi,

I haven't changed any of the elasticsearch.yml settings. It is unedited.

 ![logstash](https://us1.discourse-cdn.com/elastic/original/3X/5/8/58ef8afa4dfb03445eccd5907f3205cb29774775.PNG) ![kibana](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ad38164a328b97f30f58b10427fbf39a09785629.PNG)

Just added the following to logstash.yml -

xpack.monitoring.elasticsearch.username: "logstash"  
xpack.monitoring.elasticsearch.password: "6PkpVXNoAFD0EyD6cHT0"  
xpack.monitoring.enabled: true  
xpack.monitoring.elasticsearch.url: "[http://localhost:9200](http://localhost:9200)"  
xpack.management.elasticsearch.url: "[http://localhost:9200](http://localhost:9200)"

And the following to kibana.yml. (I am successfully able to launch kibana post xpack installation) -

elasticsearch.url: "[http://localhost:9200](http://localhost:9200)"  
elasticsearch.username: "kibana"  
elasticsearch.password: "RWRRVobuxYGYBZgISypa"

Kindly help me fix this. Let me know in case you need further info from my end.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [June 5, 2018, 9:52am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522/5 "2018-06-05T09:52:14Z")

</div>

I think its authentication issue. Could you try comment out or remove this line in logstash.yml

```auto
xpack.monitoring.elasticsearch.username: "logstash"
xpack.monitoring.elasticsearch.password: "6PkpVXNoAFD0EyD6cHT0"

```

---

<div class="post-metadata">

### Author: ![soumya\_sahoo](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@soumya\_sahoo](https://discuss.elastic.co/u/soumya_sahoo)
#### Post date: [June 6, 2018, 6:59am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522/6 "2018-06-06T06:59:34Z")

</div>

Hi,

I did commented out the 2 lines in my logstash.yml. Didn't work for me. Kindly request your attention on this.

Thanks in advance.

---

<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: [July 4, 2018, 6:59am UTC](https://discuss.elastic.co/t/unable-to-launch-logstash-and-ingest-data-got-response-code-401-contacting-elasticsearch-at-url-http-localhost-9200-xpack/134522/7 "2018-07-04T06:59:34Z")

</div>

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