I am saving logs to Elasticsearch for analysis but I found there are mixed types of a particular field which causing error when indexing the document.

For example, I may save below log to the index where `uuid` is an object.

```
POST /index-000001/_doc
{
  "uuid": {"S": "001"}
}

```

but from another event, the log would be:

```
POST /index-000001/_doc
{
  "uuid": "001"
}

```

the second POST will fail because the type of `uuid` is not an object. so I get this error: `object mapping for [uuid] tried to parse field [uuid] as object, but found a concrete value`

I wonder what the best solution for that? I can't change the log because they are from different application. The first log is from the data of dynamodb while the second one is the data from application. How can I save both types of logs into ES?

If I disable dynamic mapping, I will have to specify all fields in the index mapping. For any new fields, I am not able to search them. so I do need dynamic mapping.

There will be many cases like that. so I am looking for a solution which can cover all conflict fields.