DEV Community


Discussion on: Learn how to use Kafkacat – the most versatile Kafka CLI client

de_maric profile image
Dejan Maric Author

Hi Rakesh,
You could use a -L option without topic parameter. That will list all the topics. Do note that it will also list topic partitions. For this job I would rather recommend kafka-topics command:

kafka-topics --bootstrap-server localhost:9092 --list
rmoff profile image
Robin Moffatt

You can also do it using the JSON output and filter it with jq:

kafkacat -b broker:29092 -L -J | \
  jq '.topics[].topic'|
Enter fullscreen mode Exit fullscreen mode