Created
September 13, 2021 14:50
-
-
Save simsalabim/eb863ed7dad0ed26d94b2bec2edbb002 to your computer and use it in GitHub Desktop.
Find which consumer group a Kafka topic belongs to. `TOPIC=my.topc.name ./kafka_topic_which_consumer_group.sh`
This file contains hidden or 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/bash | |
| counter=0; | |
| for i in $(./kafka-consumer-groups.sh --list --bootstrap-server localhost:9092); do | |
| printf '\r%3d'$counter; | |
| if [[ $(./kafka-consumer-groups.sh --describe --group $i --bootstrap-server localhost:9092 2>/dev/null | grep $TOPIC) ]]; then | |
| echo " " + $i | |
| fi; | |
| ((counter++)) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment