Created
May 4, 2020 09:10
-
-
Save dainiusjocas/3a9f10d2a8b2e7951fd92b5bb1e5fdbd to your computer and use it in GitHub Desktop.
Delete kafka topics by pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./bin/kafka-topics.sh --zookeeper localhost:2181 --list | grep my_pattern | while read topic; do ./bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic $topic; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl http://localhost:9200/_cat/indices/\*indices\?h\=index | while read index ; do curl -X DELETE http://localhost:9200/$index ; done