An Ansible role for forwarding log files to CloudWatch.
You can opt to forward one or many log files to CloudWatch; each file may use a different datetime format and belong to a different log group.
aws-cloudwatch-logs
assumes you are using an official Ubuntu AMI, and it obviously only makes sense to run within EC2. Sorry if this doesn't fit your use case.
Include the aws-cloudwatch-logs
role in your playbook yml like this:
- role: aws-cloudwatch-logs
logs:
- file: /var/log/syslog
format: "%b %d %H:%M:%S"
group_name: syslog
- file: /var/log/my_cool_log
format: "%b %d %H:%M:%S"
group_name: my-cool-log
Christian Willman github@willman.io
MIT