How to Use CloudWatch Logs Insights to Analyze Logs

2021/3/51 min read
bookmark this

Here, I provide examples of how to use CloudWatch Insights to search or analyze log data in CloudWatch logs. You can query to one Log group or multiple logs together to analyze the data,  you can also save the query and save the result to the CloudWatch dashboard as well.

Following is an example about CloudWatch insight, it filters by the logStream name, and s field is "E".

This is one of the examples I'm trying to get results for MongoDB server error type logs.

filter @logStream = 'i-01beaaff1a6050989' and s = "E"
 | fields @timestamp, @message, s