Hi,
We have an application which communicates with various microservices. Some initial request to an endpoint /api
on A might generate several requests to systems B and C, and they themselves might generate further requests D, E and F, each of these requests have a UUID for each side of the transaction.
We end up with logs that are connected through these UUID id fields, where they look like this
{"timestamp":"xx", "request-id":"<UUID>-A", "response-id":"<UUID>-B", "etc"}
{"timestamp":"xx", "request-id":"<UUID>-A", "response-id":"<UUID>-C", "etc"}
{"timestamp":"xx", "request-id":"<UUID>-B", "response-id":"<UUID>-D", "etc"}
{"timestamp":"xx", "request-id":"<UUID>-C", "response-id":"<UUID>-E", "etc"}
Obviously all these logs form chains of requests, and it would be cool to be able to query on one of those IDs in kibana and get all the associated log events back. However I don't see any obvious way to link them together...
I've been using ingest pipelines to append those ids into a field "ids", which allows me to search on either Id and get transaction connected on both sites, the records end up like:
{"timestamp":"xx", ... , "ids": ["<UUID>-A","<UUID>-B"]}
{"timestamp":"xx", ... , "ids": ["<UUID>-A","<UUID>-C"]}
{"timestamp":"xx", ... , "ids": ["<UUID>-B","<UUID>-D"]}
{"timestamp":"xx", ... , "ids": ["<UUID>-C","<UUID>-E"]}
When running these queries externally, I can just iterate over the results.
So if I search for
ids: "<UUID>-A"
will return ["<UUID>-A","<UUID>-B","<UUID>-C"]
I am going to get the first two records back as well. Then I append the additional 2 ids known to those 2 records, and do another search, unitil I have expanded the query and it returns no extra records.
ids: ["<UUID>-A","<UUID>-B","<UUID>-C"]
will return all the connected records.
["<UUID>-A","<UUID>-B","<UUID>-C","<UUID>-D"]
in order to know when to finish up, if I recurse the search once, more I get the same number of ids, so I know I have found all the connected records.
I was wondering if there is any way to do this in kibana?
I have started looking at transforms. is this something that could achieve this result ?
Thanks