# Creating a role with index pattern "-abc" as to not allow index creation of this pattern is not working

**URL:** <https://discuss.elastic.co/t/creating-a-role-with-index-pattern-abc-as-to-not-allow-index-creation-of-this-pattern-is-not-working/207466>\
**Category:** Elasticsearch\
**Created:** [November 12, 2019, 8:40am UTC](https://discuss.elastic.co/t/creating-a-role-with-index-pattern-abc-as-to-not-allow-index-creation-of-this-pattern-is-not-working/207466 "2019-11-12T08:40:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshraj\_Shinde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshraj_shinde/32/49860_2.png) [@Harshraj\_Shinde](https://discuss.elastic.co/u/Harshraj_Shinde)\
**Post date:** [November 12, 2019, 8:40am UTC](https://discuss.elastic.co/t/creating-a-role-with-index-pattern-abc-as-to-not-allow-index-creation-of-this-pattern-is-not-working/207466/1 "2019-11-12T08:40:22Z")

</div>

POST \_security/role/testrole4  
{  
"cluster": [  
"all"  
],  
"indices": [  
{  
"names": [  
"-abc"  
],  
"privileges": [  
"all"  
],  
"allow\_restricted\_indices": true  
}  
],  
"applications": [  
{  
"application": "_",  
"privileges": [  
"_"  
],  
"resources": [  
"_"  
]  
}  
],  
"run\_as": [  
"_"  
],  
"transient\_metadata": {}  
}

Here I don't want index "abc" to be created, but other indices should be created but currently I am unable to create any indices. Also if I give "\*" there it works, but the validation fails as "abc " can also be created.

Thanks for help

---

<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:** [December 10, 2019, 8:40am UTC](https://discuss.elastic.co/t/creating-a-role-with-index-pattern-abc-as-to-not-allow-index-creation-of-this-pattern-is-not-working/207466/2 "2019-12-10T08:40:29Z")

</div>

Closed on December 10, 2019, 8:40am UTC

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