# Xpack - How to create kibana user

**URL:** <https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [July 18, 2019, 9:00am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165 "2019-07-18T09:00:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gidi\_Kalef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gidi_kalef/32/43651_2.png) [@Gidi\_Kalef](https://discuss.elastic.co/u/Gidi_Kalef)\
**Post date:** [July 18, 2019, 9:00am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/1 "2019-07-18T09:00:37Z")

</div>

Hi Guys,  
I'm trying to understand how X-Pack work but i think i miss something,  
Lets say in my Kibana i have the following patterns:

prod-java\*  
prod-nodejs\*

and i would like to create a role, that role will map a read permission to only "prod-java\*" pattern,  
so i create the role by the following command:  
POST \_xpack/security/role/prod-java-reader  
{  
"cluster": ["monitor"],  
"indices": [  
{  
"names": ["prod-java\*"],  
"privileges": [  
"read",  
"index",  
"indices:data/read/search[phase/query]",  
"indices:admin/validate/query",  
"indices:data/read/search",  
"indices:data/read/msearch",  
"indices:data/read/field\_stats"]

```
}

```

]  
}

After i create the role, i assigned the following roles to my user : [kibana\_user,prod-java-reader]

i login successfully, but when i switch to the pattern prod-java\* i got the following error:  
Unauthorized 403 for /search/read/data

i would like to know if i am missing something ,

my Elastic version is 6.6

Thanks!

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 22, 2019, 4:46pm UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/2 "2019-07-22T16:46:57Z")

</div>

Please take the time to correctly format your posts either using (```) blocks or the `</>` button. it is very hard to read unformatted snippets. Please take the time to fix this in your post, this will greatly improve the chances of your question being answered.

`read` should be enough for read only access, you don't need any of the other ones. .

> [@Gidi\_Kalef](#):
>
> i login successfully, but when i switch to the pattern prod-java\* i got the following error:  
> Unauthorized 403 for /search/read/data

Please copy and paste the _exact_ error you get. It is very hard to figure out what goes on when you paste approximations of the error messages.

---

<div class="post-metadata">

**Author:** ![Gidi\_Kalef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gidi_kalef/32/43651_2.png) [@Gidi\_Kalef](https://discuss.elastic.co/u/Gidi_Kalef)\
**Post date:** [July 25, 2019, 8:47am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/3 "2019-07-25T08:47:03Z")

</div>

Hi Thanks for reply!  
this is the message:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/5/15aa48f35f9ac966f34c28b1a2c626f94de2652d.png)

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 25, 2019, 9:07am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/4 "2019-07-25T09:07:09Z")

</div>

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with \</\> icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [July 25, 2019, 9:07am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/5 "2019-07-25T09:07:53Z")

</div>

Also, as I mentioned before, you don't need such a complicated role definition

> [@ikakavas](#):
>
> `read` should be enough for read only access, you don't need any of the other ones. .

---

<div class="post-metadata">

**Author:** ![Gidi\_Kalef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gidi_kalef/32/43651_2.png) [@Gidi\_Kalef](https://discuss.elastic.co/u/Gidi_Kalef)\
**Post date:** [July 25, 2019, 9:31am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/6 "2019-07-25T09:31:28Z")

</div>

Thanks for quick respond, i will try to edit 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:** [August 22, 2019, 9:31am UTC](https://discuss.elastic.co/t/xpack-how-to-create-kibana-user/191165/7 "2019-08-22T09:31:30Z")

</div>

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