# Dealing with unknown field types

**URL:** <https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614>\
**Category:** Elasticsearch\
**Created:** [June 1, 2016, 8:51pm UTC](https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614 "2016-06-01T20:51:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![545945](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/545945/32/8498_2.png) [@545945](https://discuss.elastic.co/u/545945)\
**Post date:** [June 1, 2016, 8:51pm UTC](https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614/1 "2016-06-01T20:51:40Z")

</div>

What is the best way to define mappings / settings where there are about two dozen known fixed fields with a set type but also a large set of unknown fields and types. I have tried disable auto mapping but that does not seem to work. It is still automatically defining the mapping and then of course having indexing errors as a result after only a few documents.

---

<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:** [June 2, 2016, 1:20am UTC](https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614/2 "2016-06-02T01:20:14Z")

</div>

Do you want those other fields?

---

<div class="post-metadata">

**Author:** ![545945](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/545945/32/8498_2.png) [@545945](https://discuss.elastic.co/u/545945)\
**Post date:** [June 10, 2016, 1:27pm UTC](https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614/3 "2016-06-10T13:27:44Z")

</div>

Definitely. I am just having a hard time trying to come up with a one size fits all solution that tells ES to just take any key that does not have a defined mapping and make it a string.

---

<div class="post-metadata">

**Author:** ![CVTJNII](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cvtjnii/32/11054_2.png) [@CVTJNII](https://discuss.elastic.co/u/CVTJNII)\
**Post date:** [April 20, 2017, 8:29pm UTC](https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614/4 "2017-04-20T20:29:54Z")

</div>

+1, I'm trying to solve this as well. Reading the elasticsearch docs I don't see an easy way to do this, and it looks like the logstash mutate convert function only has the ability to match known fields. I'm trying to implement a solution where known fields are mapped to a predefined type, and unknown fields are forced to string. I have multiple groups sharing ES clusters and it's fairly easy for them to step on each other with differing datatypes.

---

<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 5, 2017, 10:00pm UTC](https://discuss.elastic.co/t/dealing-with-unknown-field-types/51614/5 "2017-07-05T22:00:59Z")

</div>

Closed on July 5, 2017, 10:00pm UTC


