2025-03-14 21:59:59 -06:00
|
|
|
# awslogs
|
|
|
|
|
|
|
|
|
|
> Queries groups, streams and events from Amazon CloudWatch logs.
|
|
|
|
|
> More information: <https://github.com/jorgebastida/awslogs>.
|
|
|
|
|
|
|
|
|
|
- List log groups:
|
|
|
|
|
|
|
|
|
|
`awslogs groups`
|
|
|
|
|
|
|
|
|
|
- List existing streams for the specified group:
|
|
|
|
|
|
|
|
|
|
`awslogs streams {{/var/log/syslog}}`
|
|
|
|
|
|
|
|
|
|
- Get logs for any streams in the specified group between 1 and 2 hours ago:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`awslogs get {{/var/log/syslog}} {{[-s|--start]}} '{{2h ago}}' {{[-e|--end]}} '{{1h ago}}'`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Get logs that match a specific CloudWatch Logs Filter pattern:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`awslogs get {{/aws/lambda/my_lambda_group}} --filter-pattern '{{ERROR}}'`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Watch logs for any streams in the specified group:
|
|
|
|
|
|
|
|
|
|
`awslogs get {{/var/log/syslog}} ALL --watch`
|