Skill 4.1.3
Query logs to find relevant data.
Key Concepts
A query chains commands such as fields, filter, stats, sort, limit and parse, for example: fields @timestamp, @message | filter @message like /ERROR/ | sort @timestamp desc | limit 20. Logs Insights discovers fields in JSON logs automatically, and Lambda reports fields such as @duration, @billedDuration and @maxMemoryUsed, which you can aggregate with stats.
Queries can span several log groups and be saved or added to dashboards. For simple keyword searches, filter patterns on a log group work too, and for real-time processing you can use subscription filters.