How to get combined mapping?


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


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).


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,

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