2020-08-08 16:46:27 +01:00
|
|
|
# awslogs
|
|
|
|
|
|
|
|
> Queries groups, streams and events from Amazon Cloudwatch logs.
|
|
|
|
> 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}}'`
|
|
|
|
|
|
|
|
- Get logs that match a specific Cloudwatch Logs Filter pattern:
|
|
|
|
|
|
|
|
`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`
|