Skip to content

Instantly share code, notes, and snippets.

@ssaavedra
Created July 26, 2018 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaavedra/8345146a99c5bc68020d7eac0f0480fe to your computer and use it in GitHub Desktop.
Save ssaavedra/8345146a99c5bc68020d7eac0f0480fe to your computer and use it in GitHub Desktop.
Get latest offset from a Kafka topic
get_latest_offset () {
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list "$KAFKA_BROKER_LIST" --topic "$1" |cut -d: -f3 | sort | head -1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment