# Restrict Fields being created

**URL:** <https://discuss.elastic.co/t/restrict-fields-being-created/228060>\
**Category:** Elasticsearch\
**Created:** [April 15, 2020, 8:35am UTC](https://discuss.elastic.co/t/restrict-fields-being-created/228060 "2020-04-15T08:35:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_Morelli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_morelli/32/45072_2.png) [@Mario\_Morelli](https://discuss.elastic.co/u/Mario_Morelli)\
**Post date:** [April 15, 2020, 8:35am UTC](https://discuss.elastic.co/t/restrict-fields-being-created/228060/1 "2020-04-15T08:35:36Z")

</div>

Hi Guys

I have a question I can't get going through the forums.

Is there any way to set up a rule that will prohibit any attempt to create a field with a name that has a datetime section in it?

For e.g data comes in, and the field name they want to create = "Data2020-04-18"  
Please note I am not talking about the content within the field, just the field name itself.

Is there a way to stop certain field names being created

Thanks:)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 15, 2020, 10:00am UTC](https://discuss.elastic.co/t/restrict-fields-being-created/228060/2 "2020-04-15T10:00:43Z")

</div>

I can't see a solution for that specifically.  
You can reject any document which does not comply with the mapping with `"dynamic": "strict"` mapping option ( [https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html)) but I don't think you can define regex or things like that.  
I believe this is something you should control in your application.

---

<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:** [May 13, 2020, 10:00am UTC](https://discuss.elastic.co/t/restrict-fields-being-created/228060/3 "2020-05-13T10:00:52Z")

</div>

Closed on May 13, 2020, 10:00am UTC

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