Shouldn't this be difference of earliest and latest offset per partition sum?
bash-4.3# $KAFKA_HOME/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 10.30.26.98:32774 --topic test-topic --time -1 | awk -F ":" '{sum += $3} END {print sum}' 13818663 bash-4.3# $KAFKA_HOME/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 10.30.26.98:32774 --topic test-topic --time -2 | awk -F ":" '{sum += $3} END {print sum}' 12434609 And then the difference returns actual pending messages in topic? Am I correct?