diff --git a/lambda-loginsights-duration/README.md b/lambda-loginsights-duration/README.md new file mode 100644 index 0000000..3727219 --- /dev/null +++ b/lambda-loginsights-duration/README.md @@ -0,0 +1,10 @@ +
+ +

Explore ServerlessLand

+ + +![ServerlessLand.com](../serverlessland.png) +[Explore 700+ patterns](https://serverlessland.com/patterns?ref=github-snippets) | [Explore 50+ guides](https://serverlessland.com/learn?ref=github-snippets) | [Explore 80+ guides](https://serverlessland.com/snippets?ref=github-snippets) + +
+ diff --git a/lambda-loginsights-duration/snippet-data.json b/lambda-loginsights-duration/snippet-data.json new file mode 100644 index 0000000..d96006f --- /dev/null +++ b/lambda-loginsights-duration/snippet-data.json @@ -0,0 +1,31 @@ +{ + "title": "Lambda invocations with duration greater than a specific threshold", + "description": "Returns the list of Lambda invocations with duration greater than specific thereshold", + "type": "CloudWatch Logs Insights", + "services": ["lambda"], + "tags": ["Testing"], + "introBox": { + "headline": "How it works", + "text": ["Cloudwatch Log Insights snippet that lists the invocations with duration greater than the specified thereshold of your Lambda Lambda function." + ] + }, + "gitHub": { + "template": { + "repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/lambda-loginsights-duration" + } + }, + "snippets": [ + { + "title": "Copy the code into CloudWatch log insights", + "snippetPath": "snippet.txt", + "language": "css" + } + ], + "authors": { + "headline": "Presented by Pallavi Bhat", + "name": "Pallavi Bhat", + "imageURL": "https://drive.google.com/file/d/1xYr8HfVnLZOMmhAc9hSsyj_O85yyznF7/view?usp=sharing", + "linkedin": "https://www.linkedin.com/in/pallavi-bhat11/", + "bio": "Cloud Support Engineer at AWS." + } +} diff --git a/lambda-loginsights-duration/snippet.txt b/lambda-loginsights-duration/snippet.txt new file mode 100644 index 0000000..821ae0f --- /dev/null +++ b/lambda-loginsights-duration/snippet.txt @@ -0,0 +1,5 @@ +fields @timestamp, @message +|filter @type = "REPORT" +| parse @message /Duration: (?.*?) ms/ +| filter duration > 1000 +| sort by duration desc \ No newline at end of file