Skip to content

Instantly share code, notes, and snippets.

@jonelf
Last active September 24, 2019 11:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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