Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fogfish/awslog
Command line application to query AWS CloudWatch Logs
https://github.com/fogfish/awslog
aws-cloudwatch aws-cloudwatch-insight aws-cloudwatch-logs command-line utility
Last synced: 5 days ago
JSON representation
Command line application to query AWS CloudWatch Logs
- Host: GitHub
- URL: https://github.com/fogfish/awslog
- Owner: fogfish
- License: mit
- Created: 2021-08-05T21:01:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T17:38:12.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T16:25:36.870Z (21 days ago)
- Topics: aws-cloudwatch, aws-cloudwatch-insight, aws-cloudwatch-logs, command-line, utility
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# awslog
Command line application to query AWS CloudWatch Logs
## Getting Started
```
go install github.com/fogfish/awslog@latest
```**Note**: go get installs the application to `$GOPATH/bin`. This folder shall be accessible to your user and be part of the `PATH` environment variable. Please see [Golang instructions](https://golang.org/doc/gopath_code.html#GOPATH).
## Stream Log events
```bash
awslog stream -g "/aws/lambda/myfun" -q "some pattern"
```optionally use [filter and pattern syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) to control visibility of events.
## Query Log events
```bash
awslog latest -g "/aws/lambda/myfun" -q query.insight -t 3h
```it uses Logs Insight Queries to collect events from the logs. See [query syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html) for details
```
fields @timestamp, @message
| filter @message like /debug/ and ...
| sort @timestamp desc
| limit 20
```## License
[![See LICENSE](https://img.shields.io/github/license/fogfish/awslog.svg?style=for-the-badge)](LICENSE)