Reindex 5.3 to 6.8 Mapping Errors

I'm trying to perform a remote reindex from 5.3 - 6.8 clusters. I have added all custom fields to my new 6.8 template which should accommodate all fields for indexes in old cluster. However I'm getting the following error, and I can't see to get it to work, "Object mapping for [host] tried to parse field [host] as object, but found a concrete value". What do I need to change to make this work? There is no mention of this specific issue, the closest thing I see is people having issues with logstash.

I had a similar issue when i update to 6.x (dont now which version it was).

You can make your reindex work with the following script in the reindex call:

POST _reindex?wait_for_completion=true&refresh=true
{
  "source": {
    "index": "xxxx"
  },
  "dest": {
    "index": "xxx"
  }
  ,"script": {
    "source": "if (ctx._source.host instanceof String) {String host=ctx._source.host;ctx._source.host=['name':host];}"
  }
}

This will change the host field that was previously directly the hostname to an object where the name field is set to the previous value.

Second Possibility: because this is simply a mapping issue you could proberly simply set the field host to keyword again and it should work (haven't tested it so no promise).

Forget the second possibility you will likly have beats and logstash running which will use the new format.

1 Like

Life saver! That worked perfectly, thanks a lot.

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