I have a lambda function that writes metrics to Cloudwatch. While, it writes metrics, It generates some logs in a log-group.
INFO:: username: simran+test@example.com ClinicID: 7667 nodename: MacBook-Pro-2.local
INFO:: username: simran+test2@example.com ClinicID: 7667 nodename: MacBook-Pro-2.local
INFO:: username: simran+test@example.com ClinicID: 7668 nodename: MacBook-Pro-2.local
INFO:: username: simran+test3@example.com ClinicID: 7667 nodename: MacBook-Pro-2.local
I would like to query AWS logs in past x
hours where x could be anywhere between 12 to 24 hours, based on any of the params.
For ex:
- Query Cloudwatch logs in last 5 hours where
ClinicID=7667
or
- Query Cloudwatch logs in last 5 hours where
ClinicID=7667
andusername='simran+test@example.com'
or
- Query Cloudwatch logs in last 5 hours where
username='simran+test@example.com'
I am using boto3
in Python.