# Can't get logstash user to authenticate to ES

**URL:** https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [April 21, 2016, 4:00am UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990 "2016-04-21T04:00:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![bluethundr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluethundr/32/409_2.png) [@bluethundr](https://discuss.elastic.co/u/bluethundr)
#### Post date: [April 21, 2016, 4:00am UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990/1 "2016-04-21T04:00:59Z")

</div>

Hey guys,

I have a user setup with the logstash role:

> [root@logs:~] #esusers list|grep ls\_admin  
> ls\_admin : logstash

I've got him defined in my elasticsearch section of my output filter:

> output {  
> elasticsearch {  
> hosts =\> ["xxx.xxx.xx.xxx:9200", "xx.xx.xx.xxx:9200", "xx.xx.xx.xx:9200"]  
> user =\> "ls\_admin"  
> password =\> "secret"  
> }

And in my roles.yml fie I have my logstash role defined defined this way:

> ## The required role for logstash users
> 
> logstash:  
> cluster:  
> - manage\_index\_templates  
> indices:  
> - names: 'logstash-\*'  
> privileges:  
> - write  
> - read  
> - create\_index  
> - cluster:monitor/nodes/info  
> - cluster:monitor/health

Restarted elasticsearch. And I am still unable to create indexes with the ls\_admin user and I am still unable to access the monitoring API's.

> [root@logs:~] #curl -u ls\_admin:$ES\_PASS localhost:9200/test\_index -XPUT  
> {"error":{"root\_cause":[{"type":"security\_exception","reason":"action [indices:admin/create] is unauthorized for user [ls\_admin]"}],"type":"security\_exception","reason":"action [indices:admin/create] is unauthorized for user [ls\_admin]"},"status":403}[root@logs:~] #

> [root@logs:~] #curl -u ls\_admin:$ES\_PASS localhost:9200/\_cluster/health?pretty  
> {  
> "error" : {  
> "root\_cause" : [ {  
> "type" : "security\_exception",  
> "reason" : "action [cluster:monitor/health] is unauthorized for user [ls\_admin]"  
> } ],  
> "type" : "security\_exception",  
> "reason" : "action [cluster:monitor/health] is unauthorized for user [ls\_admin]"  
> },  
> "status" : 403  
> }

What am I doing wrong and how can I correct this?

Thanks

---

<div class="post-metadata">

### Author: ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)
#### Post date: [April 21, 2016, 11:42am UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990/2 "2016-04-21T11:42:14Z")

</div>

The two apis that you tried to use are not authorized for the logstash user based on the role.

Maybe try `curl -u ls_admin:$ES_PASS localhost:9200/logstash-test -XPUT` and see if that works. This way we can tell if they user is working.

---

<div class="post-metadata">

### Author: ![bluethundr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluethundr/32/409_2.png) [@bluethundr](https://discuss.elastic.co/u/bluethundr)
#### Post date: [April 21, 2016, 5:03pm UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990/3 "2016-04-21T17:03:22Z")

</div>

> [@jaymode](#):
>
> The two apis that you tried to use are not authorized for the logstash user based on the role.
> 
> Maybe try curl -u ls\_admin:$ES\_PASS localhost:9200/logstash-test -XPUT and see if that works. This way we can tell if they user is working.

Yeah I just tried that and it's still not working!

```
[root@logs:~] #curl -u ls_admin:$ES_PASS localhost:9200/logstash-test -XPUT
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [ls_admin]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [ls_admin]"},"status":403}

```

Any ideas how I can correct this?

---

<div class="post-metadata">

### Author: ![devday](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@devday](https://discuss.elastic.co/u/devday)
#### Post date: [February 13, 2017, 11:05am UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990/4 "2017-02-13T11:05:50Z")

</div>

Did you manage to find a solution for this?  
I've got the same issue.

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [February 13, 2017, 11:30pm UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990/5 "2017-02-13T23:30:27Z")

</div>

> [@devday](#):
>
> I've got the same issue.

Please start a new thread for your issue, and provide as much detail as you can.

---

<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, 1:41pm UTC](https://discuss.elastic.co/t/cant-get-logstash-user-to-authenticate-to-es/47990/6 "2017-07-06T13:41:18Z")

</div>


