Command-line tool to get a JSON representation of the topics included in a Kafka cluster. Includes topic metadata, configuration, partitions, replica placement, and offsets.
This information is available through multiple commands, e.g. kafka-topics
, kafka-configs
, etc.
That's why I decided to compile it in one single tool.
Add tap:
brew tap jeqo/tap
Install kfk-ctx
:
brew install kfk-cluster-state
Find the latest release at: https://github.com/jeqo/kafka-cli/releases
VERSION=0.2.1
wget https://github.com/jeqo/kafka-cli/releases/download/cli-cluster-state-v$VERSION/kfk-cluster-state-$VERSION-linux-x86_64.tar.gz
tar xf kfk-cluster-state-$VERSION-linux-x86_64.tar.gz
mv kfk-cluster-state-$VERSION-linux-x86_64/bin/kfk-cluster-state /usr/local/bin/.
- cluster
- id
- brokers[]
- id
- host
- rack
- topics
- name
- topic
- name
- id
- partitionCount
- replicationFactor
- partitions[]
- id
- leader
- replicas
- isr
- startOffset
- offset
- timestamp
- leaderEpoch
- endOffset
- offset
- timestamp
- leaderEpoch
- config
- name
- configEntry
- name
- value
- isReadOnly
- isSensitive
- isDefault
- documentation
- synonyms
NOTE: Recommended using it with jq and jless to access JSON output.