I'm trying to delete all Kafka topics at once using the kafka-topics.sh command-line tool on my Mac. I understand that the --delete flag is used for this purpose, but I'm unsure about the correct syntax and usage, particularly when using a regular expression pattern to match all topics.
Environment Details:
What I've Tried:
kafka-topics.sh --delete --zookeeper localhost:2181 --topic
kafka-topics.sh --delete --zookeeper localhost:2181 --topic '.*'
However, this command did not work as expected.
Questions:
If any more information is needed or if there are additional considerations, please let me know. Thank you!
Simply use this command. It will delete all topics in your Kafka cluster:
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic '.*'