Hi everyone,
I’m working with an Elasticsearch index that stores HTTP request logs. Each request is represented by two documents:
- A parent document with a unique
IDfield. - A child document that contains a
parentIDfield referencing the parent’sID.
Both documents share the same structure (i.e., same fields), but with different values. I’d like to merge each parent-child pair into a single document, either in the same index or a new one. Ideally, the merged document would:
- Retain all fields from the parent as-is.
- Include all fields from the child, but with a
child_prefix (e.g.,child_status,child_timestamp, etc.).
What’s the best way to achieve this in Elasticsearch/Kibana?
- Should I use a transform job, ingest pipeline, or script with
_update_by_query? - Is there a way to do this efficiently for large datasets?
Thanks in advance for your help!