0

This kcat repo has an example of how to read the last N (=2000) records in a Kafka topic (syslog in this case):

$ kcat -C -b mybroker -t syslog -p 0 -o -2000 -e

The parameter -o is offset from the end of the topic, and -e indicates till the end of the topic. If I want to stream from one specific position Nth to another position (N + k)th, without knowing the full length of the topic, what would be the syntax?

I am trying to do some sort of random sanity-check on a data being produced where the data is too large to consume all. I wish to do this by randomly consuming a range of data and validate it. Hence, this question.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Tristan Tran
  • 1,351
  • 1
  • 10
  • 36
  • 1
    Thanks. It's ```-c``` to limit the number of messages ([this article](https://dev.to/de_maric/learn-how-to-use-kafkacat-the-most-versatile-kafka-cli-client-1kb4). Closing this question. – Tristan Tran Oct 04 '21 at 22:51
  • You can run `kcat` on its own to see all the supported options... You can answer your own post down below to "close it" – OneCricketeer Oct 04 '21 at 23:15

0 Answers0