# Apply same settings on all fields that start with the same name in the index template in the Elasticsearch

**URL:** <https://discuss.elastic.co/t/apply-same-settings-on-all-fields-that-start-with-the-same-name-in-the-index-template-in-the-elasticsearch/298528>\
**Category:** Elasticsearch\
**Created:** [March 1, 2022, 2:36pm UTC](https://discuss.elastic.co/t/apply-same-settings-on-all-fields-that-start-with-the-same-name-in-the-index-template-in-the-elasticsearch/298528 "2022-03-01T14:36:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usman18](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@Usman18](https://discuss.elastic.co/u/Usman18)\
**Post date:** [March 1, 2022, 2:36pm UTC](https://discuss.elastic.co/t/apply-same-settings-on-all-fields-that-start-with-the-same-name-in-the-index-template-in-the-elasticsearch/298528/1 "2022-03-01T14:36:51Z")

</div>

n my Elasticsearch index, there is a field for example field\_abc that is an object. The problem is that multiple fields with name field\_abc can exist with different suffix. Like in our index in the same document field\_abc\_1, field\_abc\_2, field\_abc\_3 can exist. The number of such fields is not fixed and can be different in multiple documents. The structure of the object inside these fields is the same. Now in my template settings of this index, how can I make sure that same settings are applied on each such field? For example, in my index template right now I have following settings for the field\_abc

```auto
"field_abc": {
                "properties": {
                    "item": {"type": "keyword"},
                    "data": {"type": "keyword"},
                    "description": {"type": "keyword"},
                    "flag": {"type": "boolean"}
              }
}

```

As I have discussed above, I have multiple such fields that start with name field\_abc in my document and the number of such fields is not fixed. So I want to ask that how can I have a dynamic and same settings for all those fields in my index that start with the name field\_abc? Kindly guide me in this regard.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 1, 2022, 10:22pm UTC](https://discuss.elastic.co/t/apply-same-settings-on-all-fields-that-start-with-the-same-name-in-the-index-template-in-the-elasticsearch/298528/2 "2022-03-01T22:22:41Z")

</div>

You can use wildcards in mappings, see [Dynamic templates | Elasticsearch Guide [8.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html#match-unmatch)

---

<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:** [March 29, 2022, 10:23pm UTC](https://discuss.elastic.co/t/apply-same-settings-on-all-fields-that-start-with-the-same-name-in-the-index-template-in-the-elasticsearch/298528/3 "2022-03-29T22:23:40Z")

</div>

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