Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Created March 23, 2019 12:14
Show Gist options
  • Save pcolazurdo/8ea184bda930578c6e61d27cde8e024a to your computer and use it in GitHub Desktop.
Save pcolazurdo/8ea184bda930578c6e61d27cde8e024a to your computer and use it in GitHub Desktop.
Help to Maintain CloudWatch Logs Groups clean
filter=example
aws logs describe-log-groups --region us-west-2 | jq -r '.logGroups[].logGroupName' | grep $filter | while read a
do
aws logs delete-log-group --log-group-name $a --region us-west-2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment