Fixing mappings/index without loasing data

I have a bunch of fields that were interpreted as long/int instead of double/float as result I have the following conflict:
"cpuload.avg1": "Field [cpuload.avg1] of type [integer] conflicts with existing field of type [float] in other index."

And the fields are neither searchable or aggregatable.

I have tried to fix the mapping, implement dynamic mapping all to no avail I found a doc referring to ES 2.x that claimed I would have to delete the index to be able to remap.

It is my understanding that deleting the index would also mean losing all data aggregated so far, though not a disaster I would like to keep it if possible.
Is it possible to fix a field mapping without deleting the index?

Technical details: ES 5.0.1 (will probably update to 5.1.1 today/tomorrow), Kibana 5.0.1, Logstash 5.0.1, beats 5.0.2, grafana 4.1.

1 Like

Your best bet is to use the Reindex APIs. It is helpful for situations like these.

I tried using reindex, this did not help because the data is still coming in to the wrong index, it's a date-based index (similar to logstash-2017.01.15), the data gets pushed in by logstash which is parsing the json output from collectl.

I'm thinking I should somehow create a template similar to the metricbeat template and tell logstash to push it every time it creates a new day index...

Any pointers are still very welcome.

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