is there a way the results of Cloudwatch query can be used to parameterise the filter condition of a separate query?
So consider I have a query like so to grab some correlationIds out of one log group
Log Group A
fields correlationId, @timestamp, @message, @logStream, @log
| filter endpoint = 'PutServiceOption'
| filter params.ServiceOptionID = '47'
| filter response.result.StatusCode = 'PS000'
| filter strcontains(@message, '"AvailabilityData":[]')
and then I want to find corresponding entries in another log group that match these id's retrieved from my query above, something like:
Log Group B
fields fieldA, fieldB, fieldN..., @timestamp, @message, @logStream, @log
| filter correlationId IN (correlationIds found from Log Group A results)
I know I can select multiple log groups in the console to query over and have done that before when I want to retrieve all records that match a common filter condition. But I think this is a bit different since I want to be able to really do a nested query I guess.
I believe this kinda thing may have been asked before on AWS forums like - How To Filter on a subquery in Amazon Cloudwatch Insights
But I'm not sure if this feature exists yet in Cloudwatch, or if there is a better tool or technique to be using here.
Anyone come across this and found a way? Thanks