# Fls: howto grant access to all fields except those starting with 'sec'

**URL:** <https://discuss.elastic.co/t/fls-howto-grant-access-to-all-fields-except-those-starting-with-sec/44805>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [March 18, 2016, 8:13am UTC](https://discuss.elastic.co/t/fls-howto-grant-access-to-all-fields-except-those-starting-with-sec/44805 "2016-03-18T08:13:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaem2111](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaem2111/32/24961_2.png) [@kaem2111](https://discuss.elastic.co/u/kaem2111)\
**Post date:** [March 18, 2016, 8:13am UTC](https://discuss.elastic.co/t/fls-howto-grant-access-to-all-fields-except-those-starting-with-sec/44805/1 "2016-03-18T08:13:08Z")

</div>

This is a question regarding field level security.  
What is the best way to grant access to a role for all fields within an index (even upcoming) except fields, where the name of the field starts with 'sec'?

I already tried:  
...  
fields:  
- '/[^s][^e][^c].\*/'

but it didn't work.

---

<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:** [March 18, 2016, 9:35am UTC](https://discuss.elastic.co/t/fls-howto-grant-access-to-all-fields-except-those-starting-with-sec/44805/2 "2016-03-18T09:35:09Z")

</div>

Hi Martin,

Currently we do not support regexes for field level security. Fields that a user should see need to be specified in the list of allowed fields per role (wildcard patterns are allowed).

---

<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:46pm UTC](https://discuss.elastic.co/t/fls-howto-grant-access-to-all-fields-except-those-starting-with-sec/44805/3 "2017-07-06T13:46:00Z")

</div>


