15
votes

AWS CloudWatch has Log Groups and Log streams. A log group seems reasonable to me: Each product (e.g. each Lambda function, each Sagemaker endpoint) has its own log group.

But then there are log streams. When does AWS CloudWatch create new log streams? Can I search all log streams of a log group?

1

1 Answers

12
votes

From the AWS Cloudwatch documentation you can see that a log stream is created each time the logs come from a different event source. In case of Lambda, it's one stream per Lambda container where each container might process multiple events.

A log stream is a sequence of log events that share the same source. Each separate source of logs into CloudWatch Logs makes up a separate log stream.

Yes, you can search all log streams of a log group using the CloudWatch Logs API. The FilterLogEvents action allows you to search through a log group.