2020-08-08 16:46:27 +01:00
|
|
|
# awslogs
|
|
|
|
|
2021-05-20 21:13:41 +01: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:
|
|
|
|
|
|
|
|
`awslogs get {{/var/log/syslog}} --start='{{2h ago}}' --end='{{1h ago}}'`
|
|
|
|
|
2021-05-20 21:13:41 +01:00
|
|
|
- Get logs that match a specific CloudWatch Logs Filter pattern:
|
2020-08-08 16:46:27 +01:00
|
|
|
|
|
|
|
`awslogs get {{/aws/lambda/my_lambda_group}} --filter-pattern='{{ERROR}}'`
|
|
|
|
|
|
|
|
- Watch logs for any streams in the specified group:
|
|
|
|
|
|
|
|
`awslogs get {{/var/log/syslog}} ALL --watch`
|