Kafka CLI: command to list all consumer groups for a topic?

Viewed 5174
kafka-consumer-groups --bootstrap-server localhost:9092 --describe --group webapi-group

The above command gives me :

Error: Consumer group 'web-api' does not exist.

And rightly so because web-api group does not exist. I do not seem to remember what all consumer groups I had created. How do I see it?

I also tried:

bin\kafka-consumer-groups.sh -bootstrap-server localhost:9092 -list

But nothing happened.

Edit: Upon firing :

bin\kafka-consumer-groups.sh -bootstrap-server localhost:9092 --list

A terminal window opened up for a few seconds and close on its own without any output.

enter image description here

1 Answers
./bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --all-groups count_errors --describe

Use this command to list all groups and topic details. on having a consumer group you should be able to see similar response

Consumer group 'order-consumer-group' has no active members.

GROUP                TOPIC           PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID     HOST            CLIENT-ID
order-consumer-group checkins        0          18              25    

      7               -               -               -
Related