Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gammarers/aws-cloud-watch-logs-exporter
This is aws CloudWatch Logs export to s3 (daily prefix)
https://github.com/gammarers/aws-cloud-watch-logs-exporter
Last synced: about 2 months ago
JSON representation
This is aws CloudWatch Logs export to s3 (daily prefix)
- Host: GitHub
- URL: https://github.com/gammarers/aws-cloud-watch-logs-exporter
- Owner: gammarers
- Created: 2024-02-05T09:57:38.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-16T04:20:15.000Z (11 months ago)
- Last Synced: 2024-04-23T05:41:56.282Z (9 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS CloudWatch Logs Exporter (to S3 Bucket)
This is Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket. When you perform a CreateExportTask operation, you must use credentials that have permission to write to the S3 bucket that you specify as the destination.
## Notice
Archive file destination prefix format is {ExtLogGroupName}/{year}/{year}-{month}/{month}-{day}/ \
* {ExtLogGroupName} replace character
* /(slash) to -(hyphen)
* .(dot) to -(hyphen)## Usage
Get script. \
```sh
wget https://raw.githubusercontent.com/gammarer/aws-cloud-watch-logs-exporter/main/expoter.sh
```Execute this script. \
```sh
sh export.sh
```### Tips. Get LogGroup the Oldest date
```sh
date -d @$(($(aws logs describe-log-streams --log-group-name --query "min(logStreams[*].firstEventTimestamp)" --output json) / 1000)) +"%Y/%m/%d"
```## Example
```sh
sh export.sh /aws/lambda/example-function 2022/01/01 2022/12/31 example-log-archive-bucket
```