Certainly! Here are the CloudWatch Logs Insights queries for your scenarios:
fields @timestamp, @message
| filter @message like /ClinicID: 7667/
| sort @timestamp desc
| limit 20
fields @timestamp, @message
| filter @message like /ClinicID: 7667/ and @message like /username: simran\+test@example\.com/
| sort @timestamp desc
| limit 20
fields @timestamp, @message
| filter @message like /username: simran\+test@example\.com/
| sort @timestamp desc
| limit 20
For more tips on managing and querying your Python logs in AWS CloudWatch, check out this guide:
👉 Centralize Your Python Logs Like a Pro with AWS CloudWatch Logs