1

Let's say I have log group /aws/lambda/backend, which tracks logs of my Python lambda function. I want to debug common issues, like exceptions and time outs, and find related log entries.

But the function has a lot of concurrent traffic, so there are many log streams in the log group. How do I find the log entries across all logs without visiting each individual log stream and perform the search?

1 Answer 1

6

This is possible by using Logs Insights, which uses a query language to analyze logs in a log group.

For common Python function errors, I find this query useful:

fields @timestamp, @message, @logStream
| filter @message like /(?i)Exception|Error|Traceback|Timed out/
| sort @timestamp desc
| limit 20

This will return log queries and links to log groups to places, where exceptions or timeouts happened.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.