1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-07 19:15:24 +02:00
tldr/pages/common/awslogs.md

25 lines
681 B
Markdown
Raw Normal View History

2020-08-08 16:46:27 +01:00
# awslogs
> 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}} {{[-s|--start]}} '{{2h ago}}' {{[-e|--end]}} '{{1h ago}}'`
2020-08-08 16:46:27 +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}}'`
2020-08-08 16:46:27 +01:00
- Watch logs for any streams in the specified group:
`awslogs get {{/var/log/syslog}} ALL --watch`