How to list out / export all the fields along with data types

I have an index with 25000 fields and wanted to export all the fields into a csv file along with data type? is there any way to do this?

You can GET indexname/_mapping and then feed it into something like jq to do that, but there's nothing native to provide a CSV output like that.

Since I have more than 25000 fields GET indexname/_mapping is not returning result ..

Which version of Elasticsearch are you using?

Why do you have so many fields?

How many indices do you have in the cluster? How many of these do have very large number of fields?

What is the output from the _cluster/stats?pretty&human API?

Elasticsearch version we are using is 8.4.2
Different services are logging into one index, hence ended up with 25k fields.. now we wanted to do some analysis on the fields and data types, hence wanted to get all the fields and data types

we have 350 plus indices and around 80 to 100 fields have large number of fields

I am unable to copy it from my server, since it is in RDP we don't have anyway to copy the output of the API

The below link helped me to retrieve all the fields

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