I have a Docker -> Filebeat -> Elasticsearch pipeline for logs.
I am using Elasticsearch ingest pipelines to process my logs(after Filebeat sends them).
In my logs, there is a message field and payload field. Here is the fun part:
Payload is sometimes object and sometimes string.
Now, ES will clearly not allow this type clash in mapping, so whatever comes first into my index every day goes in and the other type will be invalid and throw an error. I would like to handle this in a following manner:
- Check the type of payload field
- If it is string, nest it into payload.text field
I have no idea how to do the "nesting" and also found NO way to type-check the payload field.
Is this not supported at all? Do I have to add Logstash just for this? Or can it be solved on the Filebeat side?
EDIT: mentioned ingest pipelines