Tiny utility for downloading log files from Amazon Cloud Watch.
docker build -t cwlogs .
docker build -t cwlogs .
docker run --rm -v $(pwd):/logs -e "HOME=/home" -v $HOME/.aws:/home/.aws cwlogs --group LOGS_GROUP --stream LOGS_STREAM
AWS_ACCESS_KEY_ID=$(aws --profile default configure get aws_access_key_id)
AWS_SECRET_ACCESS_KEY=$(aws --profile default configure get aws_secret_access_key)
docker run --rm -v $(pwd):/logs -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY cwlogs --group LOGS_GROUP --stream LOGS_STREAM
go install
cwlogs --group group_name --stream stream_name
Be sure you have ~/.aws/credentials
file with you AWS credentials:
[default]
aws_access_key_id = YOUR_KEY_ID
aws_secret_access_key = YOUR_SECRET
P.S. CWLOGS will download logs until an empty results returned from AWS. It means you shouldn't use it for logs that someone still writes to it.