Currently I have some microservices running along side a stack that uses Filebeat (in Daemonset mode) to collect logs, along with the ELK stack to collect and store structured json logs.
As well as using trace / span ids in distributed traces from Istio, I am hoping to find a mechanism to inject a correlation ID into logs that are output from each service on stdout before they are collected by Filebeat, without changing each service and without having to try to inject such an ID in places like an API Gateway.
Is there any mechanism that I could use to inject a correlation id strings into my structured json logs that are being output from each of my microservices, before they get collected by filebeat and sent to Logstash / Elasticsearch? It is not clear to me if this is possible from looking at the current set of documentation on the logentry or stdio objects.
Any advice on this topic would be greatly appreciated.