I need to retrieve a specific log from aws cloudwatch logs and send it out through email.
I have tried adding below filter pattern in Trigger but this is filtering events from past that is 2 months back. It is not considering the starttime & endtime provided.
Below is the filter patterns:
response = log_client.filter_log_events(
logGroupName='/path/path/path',
filterPattern='jobId',
#limit=1,
#startTime=start_epoch,
#endTime=end_epoch
)
sample Json format which i need to retrieve from cloudwatch logs and send to email is :
{
"jobId": "123456",
"success": "OK",
"message": "Scheduled"
}