AWS Cloudwatch to S3
I've been researching on how to move Cloudwatch logs to S3 Bucket for archiving purposes. Cloudwatch logs can be manually exported as one of its Action menu. Maybe in the future it can be one of its feature to automate but right now I need to create a solution to automate it.
Good thing there is an AWS CLI we can use to automate it. First you need to install the python AWS plugin in able to use it.
https://pypi.python.org/pypi/awscli-cwlogs/1.4.0
Once installed, in may case, I use a linux box for my automation tool (e.g. Puppet, git, ansible, etc.). I just created a cron job that will export the logs to S3 bucket.
0 0 * * * /usr/local/bin/aws logs create-export-task --task-name "LogExport1" --log-group-name "Windows" --destination "prod-os-logs1" --destination-prefix "WindowsLogs/$(date)" --from "$(($(date +\%s\%3N) - 86400000))" --to "$(date +\%s\%3N)"
Where "Windows" is Cloudwatch log group and "prod-os-logs1" is S3 Bucket
Wednesday, September 14, 2016
Saturday, July 9, 2016
Tuesday, March 29, 2016
Tuesday, March 8, 2016
IETF best current practices (BCP) (Link/s)
For Reference:
https://www.ietf.org/rfc/bcp-index.txt
https://en.wikipedia.org/wiki/Best_current_practice
https://www.ietf.org/rfc/bcp-index.txt
https://en.wikipedia.org/wiki/Best_current_practice
Subscribe to:
Posts (Atom)