Skip to content

Instantly share code, notes, and snippets.

Last active Sep 24, 2019
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