# 'invalid\_index\_name\_exception' when create a user for kibana server

**URL:** <https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [December 5, 2016, 10:27am UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019 "2016-12-05T10:27:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![minhyuk](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@minhyuk](https://discuss.elastic.co/u/minhyuk)\
**Post date:** [December 5, 2016, 10:27am UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019/1 "2016-12-05T10:27:25Z")

</div>

Hi all,  
Currently, I'm trying to use Kibana with shield, but when I execute the command:  
curl -u es\_admin -XPOST '[http://localhost:9200/logstash-](http://localhost:9200/logstash-)_/user/kibana-server'  
-d '{"password" : "mypassword", "roles" : ["kibana4\_server"]}'  
'logstash-_' is the index I created, I got an error:  
{"error":{"root\_cause":[{"type":"invalid\_index\_name\_exception","reason":"Invalid index name [logstash-_], must not contain the following characters [\, /, , ?, ", logstash-"}],"type":"invalid\_index\_name\_exception","reason":"Invalid index name [logstash-_], must not contain the following characters [\, /, \*, ?, ", \<, \>, |, ,},"status":400}  
before this, I have done following:

1. bin/plugin install license
2. bin/plugin install shield
3. bin/elasticsearch
4. bin/shield/esusers useradd es\_admin -r admin  
At this time , I executed the command 'curl -u es\_admin -XGET "[http://localhost:9200/](http://localhost:9200/)"', get these:  
{  
"name" : "node-1",  
"cluster\_name" : "my-application",  
"version" : {  
"number" : "2.3.1",  
"build\_hash" : "bd980929010aef404e7cb0843e61d0665269fc39",  
"build\_timestamp" : "2016-04-04T12:25:05Z",  
"build\_snapshot" : false,  
"lucene\_version" : "5.5.0"  
},  
"tagline" : "You Know, for Search"  
}
5. /usr/local/elasticsearch/bin/shield/esusers useradd kibana4-server -r kibana4\_server -p password

I don't know how to resolve this problem. Do I have missed some configures or have configured wrong info?  
I'm new to plugin shield and elk. So would you please help me to give me any solutions and advices?

---

<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:** [December 5, 2016, 12:39pm UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019/2 "2016-12-05T12:39:10Z")

</div>

Hi,

The command you used is actually trying to create a index named `logstash-*` with the type `user` and a document id of `kibana_server`.

Please see the API documentation for more information [https://www.elastic.co/guide/en/shield/current/shield-rest.html#shield-users-rest](https://www.elastic.co/guide/en/shield/current/shield-rest.html#shield-users-rest)

Also, if you are just getting started maybe you can use 5.0 with X-Pack. The UI will make creating and managing users easier.

-Jay

---

<div class="post-metadata">

**Author:** ![minhyuk](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@minhyuk](https://discuss.elastic.co/u/minhyuk)\
**Post date:** [December 6, 2016, 7:42am UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019/3 "2016-12-06T07:42:47Z")

</div>

Thanks for your reply, and I'll try 5.0 with X-Pack.  
But I don't think that command I used is to create an index, I got it from [https://www.elastic.co/guide/en/shield/current/kibana.html](https://www.elastic.co/guide/en/shield/current/kibana.html)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/0701eac140250708493308a297294ac2e23e50ed.png)  
I'm uncertain about what '\_shield' means.

---

<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:** [December 6, 2016, 11:36am UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019/4 "2016-12-06T11:36:12Z")

</div>

The command on that page is different as you noted. The `_shield` part is not an index name or pattern but is instead the prefix for the [shield APIs](https://www.elastic.co/guide/en/shield/current/shield-rest.html#shield-users-rest). So you need to use the command like it is on the page, rather than changing it.

---

<div class="post-metadata">

**Author:** ![minhyuk](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@minhyuk](https://discuss.elastic.co/u/minhyuk)\
**Post date:** [December 7, 2016, 7:53am UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019/5 "2016-12-07T07:53:08Z")

</div>

Thanks.  
That command is to create an user for kibana, so user can login [https://localhost:5601](https://localhost:5601).  
😊

---

<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:** [January 4, 2017, 7:53am UTC](https://discuss.elastic.co/t/invalid-index-name-exception-when-create-a-user-for-kibana-server/68019/6 "2017-01-04T07:53:24Z")

</div>

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