Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Last active December 18, 2019 14:24
Show Gist options
  • Save pcolazurdo/4f5ca1d58e83f11f8433eb30566c1111 to your computer and use it in GitHub Desktop.
Save pcolazurdo/4f5ca1d58e83f11f8433eb30566c1111 to your computer and use it in GitHub Desktop.
Some useful AWS Log Insights queries

-- Display Lambda Errors Frequency

fields @timestamp, @message
| PARSE @message "[*] *" as loggingType, loggingMessage
| FILTER loggingType = "ERROR"
| sort @timestamp desc
| limit 20

-- Count SQS Messages in Lambda every 5s

filter @message like /Records/
| stats sum(Records.0.attributes.ApproximateReceiveCount) by bin(5s)
| sort @timestamp desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment