https://github.com/shirou/awslogsgo
Go port of awslogs
https://github.com/shirou/awslogsgo
aws-cloudwatch-logs cloudwatch-logs golang
Last synced: 6 months ago
JSON representation
Go port of awslogs
- Host: GitHub
- URL: https://github.com/shirou/awslogsgo
- Owner: shirou
- License: bsd-2-clause
- Created: 2018-02-24T16:27:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-27T14:36:25.000Z (over 6 years ago)
- Last Synced: 2025-03-25T10:37:29.348Z (7 months ago)
- Topics: aws-cloudwatch-logs, cloudwatch-logs, golang
- Language: Go
- Size: 16.6 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# awslogsgo
A go port of [awslogs](https://github.com/jorgebastida/awslogs).
This `aslogsgo` has almost same options to awslogs, but this is very fast!
# Usage
## List log groups
```
NAME:
awslogsgo groups - list log groupsUSAGE:
awslogsgo groups [command options] [arguments...]OPTIONS:
--aws-access-key-id value aws access key id [$AWS_ACCESS_KEY_ID]
--aws-secret-access-key value aws secret access key [$AWS_SECRET_ACCESS_KEY]
--aws-session-token value aws session token [$AWS_SESSION_TOKEN]
--profile value aws profile [$AWS_PROFILE]
--aws-region value aws region [$AWS_REGION]
-p PREFIX, --log-group-prefix PREFIX List only groups matching the PREFIX (default: "/")
```## List log streams
```
NAME:
awslogsgo streams - list log streamUSAGE:
awslogsgo streams [command options] log_group_nameOPTIONS:
--aws-access-key-id value aws access key id [$AWS_ACCESS_KEY_ID]
--aws-secret-access-key value aws secret access key [$AWS_SECRET_ACCESS_KEY]
--aws-session-token value aws session token [$AWS_SESSION_TOKEN]
--profile value aws profile [$AWS_PROFILE]
--aws-region value aws region [$AWS_REGION]
-s START, --start START START time (default: "1h")
-e END, --end END END time
-p value, --log-stream-prefix value List only stream matching the prefix
```## Get logs
```
NAME:
awslogsgo get - get log streamUSAGE:
awslogsgo get [command options] log_group_name log_stream_nameOPTIONS:
--aws-access-key-id value aws access key id [$AWS_ACCESS_KEY_ID]
--aws-secret-access-key value aws secret access key [$AWS_SECRET_ACCESS_KEY]
--aws-session-token value aws session token [$AWS_SESSION_TOKEN]
--profile value aws profile [$AWS_PROFILE]
--aws-region value aws region [$AWS_REGION]
-f PATTERN, --filter-pattern PATTERN A valid CloudWatch Logs filter PATTERN to use for filtering the response. If not provided, all the events are matched.
-w, --watch Query for new log lines constantly
-G, --no-group Do not display group name
-S, --no-stream Do not display stream name
--timestamp Add creation timestamp to the output
--ingestion-time Add ingestion time to the output
-s START, --start START START time (default: "5m")
-e END, --end END END time
--no-color Do not color output
```### Date
You can also specify human readable strings such as `1h`, `3d` to set relative date.
- m, min, mins, minute, minutes
- h, hour, hours
- d, day, days
- w, week, weeks## Thanks
- awslogs https://github.com/jorgebastida/awslogs
- cwlogs https://github.com/segmentio/cwlogs/# License
BSD License (same as awslogs)