Skip to content

Latest commit

 

History

History

cluster-state

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

kfk-cluster-state - Kafka CLI: cluster state

cli:cluster-state:build

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.

Install

Brew

Add tap:

brew tap jeqo/tap

Install kfk-ctx:

brew install kfk-cluster-state

Manual

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/.

How to use

asciicast

Output structure

  • 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.