Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this script will clear up and remove all registered cloudwatch log streams
- # there's no filter so use it with caution
- import boto3
- client = boto3.client('logs')
- while True:
- response = client.describe_log_groups()
- if not response or 'logGroups' not in response:
- break
- logs = response['logGroups']
- if not logs or len(logs) == 0:
- break
- for logGroup in logs:
- name = logGroup['logGroupName']
- print 'deleting', name
- client.delete_log_group(logGroupName=name)
- print 'done'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement