Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. # this script will clear up and remove all registered cloudwatch log streams
  2. # there's no filter so use it with caution
  3.  
  4. import boto3
  5.  
  6. client = boto3.client('logs')
  7.  
  8. while True:
  9. response = client.describe_log_groups()
  10. if not response or 'logGroups' not in response:
  11. break
  12. logs = response['logGroups']
  13. if not logs or len(logs) == 0:
  14. break
  15. for logGroup in logs:
  16. name = logGroup['logGroupName']
  17. print 'deleting', name
  18. client.delete_log_group(logGroupName=name)
  19.  
  20. print 'done'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement