I am trying to get all the error logs from aws cloudwatch, to do this I tried looping through all log group names and running this code:
client.start_query(
logGroupName=group, # log group name
startTime = int(creation_time)*1000, # Time the log group was created
endTime = int(last_event_time.timestamp() * 1000), # current datetime
queryString='filter @message like /ERROR/',
)
But start_query timeouts after 15 mins, and the only workaround would be limiting time range and this doesn't seem to be a viable option because I wouldn't know what time range would work.
What would be a better approach for this?