I'm pretty new to AWS CloudWatch logs query syntax and looking for a solution to my problem.
I want to come up with proper CloudWatch query that would display all the logs from a specific log stream if one log in it contains a unique value. It looks like executing 1 query based on the result of the previous.
First one looks like:
fields @message, @logStream
| filter @message like /UNIQUE_VALUE/
And it yields result in a following form:
# @message @logStream
1 UNIQUE_VALUE log_stream/1a23c4
And the last query:
fields @message
| filter @logStream like "log-stream/1a23c4"
| sort asc
Ideally, I want to make it a parameterised CloudWatch query - I input UNIQUE_VALUE and receive an output of last query.