Skip to content

Instantly share code, notes, and snippets.

@neilkuan
Created October 20, 2020 07:17
Show Gist options
  • Select an option

  • Save neilkuan/ddaf4003dd757d6c7b6b44bc75e8283b to your computer and use it in GitHub Desktop.

Select an option

Save neilkuan/ddaf4003dd757d6c7b6b44bc75e8283b to your computer and use it in GitHub Desktop.
#!/bin/bash
export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-streams --log-group-name fluentbit-cloudwatch --query 'logStreams[*].logStreamName' --output table \
| awk '{print $2}' | grep ^$2 \
| while read x; do echo "deleting $x" ; aws logs delete-log-stream --log-group-name $1 --log-stream-name $x; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment