How do CloudWatch Logs groups, streams and Logs Insights work?
BeginnerConceptObservability, Security Services and IaC
Answer
A log group holds streams (one per source such as an instance or container) and defines retention and encryption. Retention defaults to never expire, so set it. Logs Insights is a query language over one or more groups, and metric filters turn log patterns into metrics.
fields @timestamp, @message
| filter @message like /ERROR/
| stats count() by bin(5m)
More on Observability, Security Services and IaC
How are CloudWatch metrics organized?BeginnerExplain CloudWatch alarm states and missing data handling.AdvancedWhat is the CloudWatch Embedded Metric Format?AdvancedWhat does EC2 not report to CloudWatch by default?IntermediateWhat does CloudTrail record?BeginnerWhat is AWS Config and how do rules work?Intermediate