Skip to content

Instantly share code, notes, and snippets.

@tobilg
Last active January 26, 2024 18:26
Show Gist options
  • Save tobilg/332fc9cfd35e7d32be8352efdbcd1edc to your computer and use it in GitHub Desktop.
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
#!/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