2020-08-08 16:46:27 +01:00
|
|
|
# awslogs
|
|
|
|
|
2021-05-20 16:13:41 -04:00
|
|
|
> Queries groups, streams and events from Amazon CloudWatch logs.
|
2020-08-08 16:46:27 +01:00
|
|
|
> More information: <https://github.com/jorgebastida/awslogs>.
|
|
|
|
|
|
|
|
- List log groups:
|
|
|
|
|
|
|
|
`awslogs groups`
|
|
|
|
|
2020-08-10 00:32:56 +01:00
|
|
|
- List existing streams for the specified group:
|
2020-08-08 16:46:27 +01:00
|
|
|
|
|
|
|
`awslogs streams {{/var/log/syslog}}`
|
|
|
|
|
|
|
|
- Get logs for any streams in the specified group between 1 and 2 hours ago:
|
|
|
|
|
2025-05-03 05:57:20 +03:00
|
|
|
`awslogs get {{/var/log/syslog}} {{[-s|--start]}} '{{2h ago}}' {{[-e|--end]}} '{{1h ago}}'`
|
2020-08-08 16:46:27 +01:00
|
|
|
|
2021-05-20 16:13:41 -04:00
|
|
|
- Get logs that match a specific CloudWatch Logs Filter pattern:
|
2020-08-08 16:46:27 +01:00
|
|
|
|
2025-05-03 05:57:20 +03:00
|
|
|
`awslogs get {{/aws/lambda/my_lambda_group}} --filter-pattern '{{ERROR}}'`
|
2020-08-08 16:46:27 +01:00
|
|
|
|
|
|
|
- Watch logs for any streams in the specified group:
|
|
|
|
|
|
|
|
`awslogs get {{/var/log/syslog}} ALL --watch`
|