Skip to content

Instantly share code, notes, and snippets.

@dubcl
Forked from clarksun/kafka_topic_msg_count.sh
Created September 11, 2018 19:46
Show Gist options
  • Save dubcl/a804bf6147e78a05ac675c34fa4281c8 to your computer and use it in GitHub Desktop.
Save dubcl/a804bf6147e78a05ac675c34fa4281c8 to your computer and use it in GitHub Desktop.
get kafka topic message count
kafka-run-class kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic xxx --time -1 --offsets 1 | awk -F ':' '{sum += $3} END {print sum}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment