Last active
January 26, 2024 18:26
-
-
Save tobilg/332fc9cfd35e7d32be8352efdbcd1edc to your computer and use it in GitHub Desktop.
Use it like this: ./find_lambda_at_edge_logs.sh YOUR_FUNCTION_NAME
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FUNCTION_NAME=$1 | |
for region in $(aws --output text ec2 describe-regions | cut -f 4) | |
do | |
echo "Checking $region" | |
for loggroup in $(aws --output text logs describe-log-groups --log-group-prefix "/aws/lambda/us-east-1.$FUNCTION_NAME" --region $region --query 'logGroups[].logGroupName') | |
do | |
echo "Found '$loggroup' in region $region" | |
for logstream in $(aws --output text logs describe-log-streams --log-group-name $loggroup --region $region --query 'logStreams[].logStreamName') | |
do | |
aws --output text logs get-log-events --log-group-name $loggroup --region $region --log-stream-name $logstream | cat | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment