# How to get combined mapping?

**URL:** <https://discuss.elastic.co/t/how-to-get-combined-mapping/74214>\
**Category:** Elasticsearch\
**Created:** [February 7, 2017, 11:30am UTC](https://discuss.elastic.co/t/how-to-get-combined-mapping/74214 "2017-02-07T11:30:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [February 7, 2017, 11:30am UTC](https://discuss.elastic.co/t/how-to-get-combined-mapping/74214/1 "2017-02-07T11:30:21Z")

</div>

Hi,

we are currently using dynamic mapping, means if a new field is exported by logstash, it will be present by

GET /\_all/\_mapping/tweet,book.

My problem is: I have daily rotating indexes.  
If I use the \_mapping function, it gives me a list of the mappings for each day. Since not all fields are created every day, the mapping is differing between the days for the same index-prefix.

How can I get a combined mapping of all days - duplicates removed - to export it to use it as a mapping template?

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 7, 2017, 12:45pm UTC](https://discuss.elastic.co/t/how-to-get-combined-mapping/74214/2 "2017-02-07T12:45:16Z")

</div>

Hey,

Elasticsearch views each index separately. You would need to merge this on the client side (as ES cant tell, what should happen if you find a field that is a string one day and because of a changed index template an integer the next day).

--Alex

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [February 9, 2017, 12:42pm UTC](https://discuss.elastic.co/t/how-to-get-combined-mapping/74214/3 "2017-02-09T12:42:39Z")

</div>

Is there at least a way to sort the output by name, that i can diff each index mapping in tools like winmerge? So that types and fields have the same order each day. Than I can quite easily see, if there is a field missing or if the type has been changed,

---

<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 9, 2017, 12:42pm UTC](https://discuss.elastic.co/t/how-to-get-combined-mapping/74214/4 "2017-03-09T12:42:45Z")

</div>

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