Skip to content

Instantly share code, notes, and snippets.

@vishichoudhary
Created April 7, 2020 06:46
Show Gist options
  • Save vishichoudhary/3eccbaa724f274eeb54c2c2ea08145e8 to your computer and use it in GitHub Desktop.
Save vishichoudhary/3eccbaa724f274eeb54c2c2ea08145e8 to your computer and use it in GitHub Desktop.
delete all kafka topics
#!/bin/bash
kT='/Users/vishalchoudhary/confluent-5.3.0/bin/kafka-topics'
TOPICS=$($kT --zookeeper localhost:2181 --list )
echo $TOPICS
for T in $TOPICS
do
if [ "$T" != "__consumer_offsets" ]; then
$kT --zookeeper localhost:2181 --delete --topic $T
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment