Writing java code for filtering logs from cloudwatch log group
I am testing java code for filtering cloudwatch log group with following query:
Ensure important logs are send to cloudwatch via cloudwatch log agent when instance is terminated with lifecycle hook
I have an Autoscaling group, with EC2 instances that are manage via lifecycle hooks.
One thing the lifecycle hooks do, is some cleanup on the EC2 Instances ensuring all processes are stopped properly. For debugging purposes, this cleanup is logged to log files that are send to cloudwatch logs via cloudwatch log agent.