rpk topic consume

An rpk command that reads records from a topic and prints them, optionally from a chosen offset and in a chosen format.

In more detail

The -o flag picks the starting offset, --num stops after a number of records and -f sets a format string where %k is the key, %v the value, %o the offset and %p the partition. Headers are not printed unless the format asks for them.

Example

rpk topic consume events -f '%p %o %k %v\n' -o 0 --num 3

Related terms

Taught in

References