Tail an AWS CloudWatch Log Group

I have a Log Group that includes several Log Streams (from several EC2 instances). Is there any way to simply "tail" the consolidated logs in the group? If I click "Search Events" that shows the consolidated logs but the button that jumps to the end of the logs is grayed out. I have to manually plug in the date and time. I also tried the aws cli, but aws logs get-log-events requires a single log stream name to be specified.


Solution 1:

A couple of command tools for a CloudWatch tail:

  • https://github.com/jorgebastida/awslogs
  • https://github.com/liamoehlman/cloudwatch-logs-tail

Solution 2:

This is now possible directly using AWS CLI v2. For example:

aws logs tail --since 1d --follow /aws/lambda/my_func

will tail and continuously watch CloudWatch logs from 1 day ago and forward into the future.

More here: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/logs/tail.html