# List dynamic field mapping

**URL:** <https://discuss.elastic.co/t/list-dynamic-field-mapping/211141>\
**Category:** Elasticsearch\
**Created:** [December 9, 2019, 2:35pm UTC](https://discuss.elastic.co/t/list-dynamic-field-mapping/211141 "2019-12-09T14:35:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gborg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gborg/32/58934_2.png) [@gborg](https://discuss.elastic.co/u/gborg)\
**Post date:** [December 9, 2019, 2:35pm UTC](https://discuss.elastic.co/t/list-dynamic-field-mapping/211141/1 "2019-12-09T14:35:36Z")

</div>

Hello, for my main index I have pre-defined fields using ECS and defining my own expanded fields.

There are however some fields in there that I did not define and they get in via dynamic mapping and get mapped as keyword. I wanna keep defining things, is there any simple way for me to get a list of fields in an index that were created dynamically ?

If not, I guess I will just be writing some software to compare the index template and the response from the mapping API

---

<div class="post-metadata">

**Author:** ![gborg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gborg/32/58934_2.png) [@gborg](https://discuss.elastic.co/u/gborg)\
**Post date:** [December 10, 2019, 12:00pm UTC](https://discuss.elastic.co/t/list-dynamic-field-mapping/211141/2 "2019-12-10T12:00:04Z")

</div>

Not having found a solution I sat down and wrote some dirty code for this.

If anyone needs to solve the same issue, here you go:

> <https://gist.github.com/gbit-is/d9eab152d4b2ddd54e6bc5d8db9d3ce5>

---

<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 7, 2020, 12:00pm UTC](https://discuss.elastic.co/t/list-dynamic-field-mapping/211141/3 "2020-01-07T12:00:05Z")

</div>

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