# Access Denied to ES

**URL:** https://discuss.elastic.co/t/access-denied-to-es/61427
**Category:** Logstash
**Created:** [September 23, 2016, 11:49pm UTC](https://discuss.elastic.co/t/access-denied-to-es/61427 "2016-09-23T23:49:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)
#### Post date: [September 23, 2016, 11:49pm UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/1 "2016-09-23T23:49:07Z")

</div>

I am trying to use logstash beta version 5.0 to parse data. I also installed Xpacks. However, below is the error code. How could i access ES server (beta version):

[2016-09-23T16:44:28,382][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>[], :added=\>["[http://localhost:9200](http://localhost:9200)"]}}  
[2016-09-23T16:44:28,385][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=\>nil}  
[2016-09-23T16:44:28,450][ERROR][logstash.outputs.elasticsearch] **Failed to install template. {:message=\>"Got response code '401' contact Elasticsearch at URL '[http://localhost:9200](http://localhost:9200)'",** :class=\>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError"}  
[2016-09-23T16:44:28,451][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["localhost:9200"]}  
[2016-09-23T16:44:28,452][INFO][logstash.pipeline] Starting pipeline {"id"=\>"main", "pipeline.workers"=\>8, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>1000}  
[2016-09-23T16:44:28,455][INFO][logstash.pipeline] Pipeline main started  
[2016-09-23T16:44:28,489][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
hello  
[2016-09-23T16:44:56,777][ERROR][logstash.outputs.elasticsearch] **Got a bad response code from server, but this code is not considered retryable. Request will be dropped {:code=\>401}**

---

<div class="post-metadata">

### Author: ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)
#### Post date: [September 24, 2016, 12:40am UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/2 "2016-09-24T00:40:29Z")

</div>

solved. Need to set access in Kibana

---

<div class="post-metadata">

### Author: ![ambroseyo](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@ambroseyo](https://discuss.elastic.co/u/ambroseyo)
#### Post date: [October 28, 2016, 1:28am UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/3 "2016-10-28T01:28:03Z")

</div>

Can you clarify what you did the solve the problem? I started hitting this issue once I enabled X-Pack in the cluster. V5.0.0.

```
[2016-10-27T18:08:26,553][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>["http://logstash:7XcEdf667kNh9C8f9tBt@localhost:9200"]}}
[2016-10-27T18:08:26,555][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=>nil}
[2016-10-27T18:08:26,745][ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=>"Got response code '401' contact Elasticsearch at URL 'http://~hidden~:~hidden~@localhost:9200'", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError"}
[2016-10-27T18:08:26,746][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["localhost"]}
[2016-10-27T18:08:26,754][INFO][logstash.pipeline] Starting pipeline {"id"=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>1000}
[2016-10-27T18:08:26,768][INFO][logstash.pipeline] Pipeline main started
[2016-10-27T18:08:26,845][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2016-10-27T18:08:27,221][ERROR][logstash.outputs.elasticsearch] Got a bad response code from server, but this code is not considered retryable. Request will be dropped {:code=>401}

```

Edit: See [https://www.elastic.co/guide/en/x-pack/current/logstash.html](https://www.elastic.co/guide/en/x-pack/current/logstash.html) for instructions on adding logstash\_writer role and creating a logstash\_internal user in the Management \> Roles UI in Kibana

---

<div class="post-metadata">

### Author: ![Generalibm\_Jang](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Generalibm\_Jang](https://discuss.elastic.co/u/Generalibm_Jang)
#### Post date: [November 9, 2016, 7:15am UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/4 "2016-11-09T07:15:28Z")

</div>

I 've met the same problem, I just want to how to set access in Kibana!

Could you show more clues???

---

<div class="post-metadata">

### Author: ![robertchen117](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@robertchen117](https://discuss.elastic.co/u/robertchen117)
#### Post date: [November 29, 2016, 7:20pm UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/5 "2016-11-29T19:20:25Z")

</div>

trying to add user and password to logstash, it even does not recognize:

> [@Add user and password and failed](https://discuss.elastic.co/t/add-user-and-password-and-failed/67525):
>
> I followed this doc after I installed x-pack. And I update my logstash.conf with user and password. the error is: [LogStash::Runner] FATAL logstash.runner - The given configuration is invalid. Reason: Expected one of #, { at line 6, column 8 (byte 81) after input { input { beats { host =\> "10.8.8.53" port =\> "5044" } user =\> logstash\_internal password =\> Password1 } I followed this doc: [https://www.elastic.co/guide/en/x-pack/current/logstash.html](https://www.elastic.co/guide/en/x-pack/current/logstash.html) input { ... user =\> logstash\_inter…

---

<div class="post-metadata">

### Author: ![robertchen117](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@robertchen117](https://discuss.elastic.co/u/robertchen117)
#### Post date: [November 30, 2016, 2:54pm UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/6 "2016-11-30T14:54:30Z")

</div>

Did you find the solution?

---

<div class="post-metadata">

### Author: ![aparadka](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@aparadka](https://discuss.elastic.co/u/aparadka)
#### Post date: [December 1, 2016, 11:08am UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/7 "2016-12-01T11:08:23Z")

</div>

how to do that? i followed the steps on that link and i'm getting this error now

> [@Add user and password and failed](https://discuss.elastic.co/t/add-user-and-password-and-failed/67525):
>
> I followed this doc after I installed x-pack. And I update my logstash.conf with user and password. the error is: [LogStash::Runner] FATAL logstash.runner - The given configuration is invalid. Reason: Expected one of #, { at line 6, column 8 (byte 81) after input { input { beats { host =\> "10.8.8.53" port =\> "5044" } user =\> logstash\_internal password =\> Password1 } I followed this doc: [https://www.elastic.co/guide/en/x-pack/current/logstash.html](https://www.elastic.co/guide/en/x-pack/current/logstash.html) input { ... user =\> logstash\_inter…

---

<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 6, 2017, 4:30am UTC](https://discuss.elastic.co/t/access-denied-to-es/61427/8 "2017-07-06T04:30:06Z")

</div>


