Hello all,
I'm unable to find documentation on the following which I believe might be a niche implementation, but will try to explain the best I can. My inexperience aside, at first glance this seems to probably relate to runtime fields.
Goal:
Use field data from one document type ("child"), to match to another document ("parent") and obtain unique attribute data; all documents are part of the same index. The parent event contains unique fields not provided in a child event, but the child event has an identifier which links to the parent.
Explanation:
The configuration is Logstash shipping logs to Elasticsearch (7.16.1) . The application generates JSON messages with different structures depending on the originating object. Logstash will filter and make each unique message "type" it's own root object for indexing. Example:
Message 1:
{
"type": "ship",
"uniqueId": 1.1,
"originatingCountry": 2
}
Message 2:
{
"type": "container",
"uniqueId": 1.2,
"sourceId": 1.1,
"weight": 2
}
The above would basically have (2) root level object types generated; ship and container. All documents are ingested and time stamp sorted at event time, but will occur at different times as events are generated.
In the above scenario, the index would be filled with several event; multiple unique ships and multiple unique containers. Assume I have a few documents which have container data, I would be able to sort and visualize based on container.uniqueId for all the container related data.
Say now you'd want to cross reference some of the container data with originating country to setup further visuals? Setup a filter (runtime field maybe?) which verifies something along the lines of:
if container.sourceId exists (for this document)
then check if container.sourceId == ship.uniqueId (go look up all existing documents for ship id)
create new field container.originatingCountry
This requires a degree of provenance which is probably not the design intent of Elasticsearch, but any help would be appreciated.
Edit:
To be clear I'm encountering issues in the "then check if" stage of the logic. Due to the events occurring at different times.