Skip to content

Instantly share code, notes, and snippets.

@nitesh8860
Created May 23, 2021 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitesh8860/0841118dc87b574ed5e60d76d38cf5a0 to your computer and use it in GitHub Desktop.
Save nitesh8860/0841118dc87b574ed5e60d76d38cf5a0 to your computer and use it in GitHub Desktop.
deletes log groups in bulk from cloudwatch
export AWS_DEFAULT_REGION=eu-west-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep ^/aws/rds | while read x; do echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment