Skip to content

Instantly share code, notes, and snippets.

@jonelf
Last active September 24, 2019 11:46
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 jonelf/2e359f9a1ac55e5360088d93098d06b9 to your computer and use it in GitHub Desktop.
Save jonelf/2e359f9a1ac55e5360088d93098d06b9 to your computer and use it in GitHub Desktop.
Searching for and deleting a number of AWS CloudWatch Log Groups

If you ever want to delete a bunch of log groups:

$ aws --profile ProfileName logs describe-log-groups --output table | awk '{print $6}' | grep lambdaNamePrefix | sed -E "s/(.*)/aws --profile ProfileName logs delete-log-group --log-group-name \1/"

PS. This only returns a number of delete-log-group commands but does not execute them. DS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment