Skip to content
Open
11 changes: 7 additions & 4 deletions modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Consuming records reads from any amount of input topics, formats each record
according to `--format`, and prints them to `STDOUT`. The output formatter
understands a wide variety of formats.

The default output format `--format json` is a special format that outputs each
record as JSON.
`--format json` is the default, and outputs each record as a JSON object.

include::reference:partial$topic-format.adoc[]

Expand Down Expand Up @@ -82,7 +81,7 @@ specification, similar to timestamps above.

Unpacking text can allow translating binary input into readable output. If a
value is a big-endian uint32, `%v` prints the raw four bytes, while
`%v{unpack[>I]}` prints the number in as ASCII. If unpacking exhausts the
`%v{unpack[>I]}` prints the number as ASCII. If unpacking exhausts the
input before something is unpacked fully, an error message is appended to the
output.

Expand All @@ -103,7 +102,7 @@ of the above rules about `%K`, `%V`, text, and numbers apply.

Values for consumed records can be omitted by using the `--meta-only` flag.

Tombstone records (records with a `null` value) have their value omitted from the JSON output by default. All other records, including those with an empty-string value (`""`), will have their values printed.
Tombstone records (records with a `null` value) have their value omitted from the JSON output by default. All other records, including those with an empty-string value (`""`), have their values printed.

== Offsets

Expand Down Expand Up @@ -257,4 +256,8 @@ any expression.
|-v, --verbose |- |Enable verbose logging.
|===

== Connection behavior

By default, `rpk topic consume` runs continuously, waiting for new records to arrive. It does not exit after consuming existing records. To stop consuming, press kbd:[Ctrl+C]. You can also use `--num` to exit after a fixed number of records, or use `--offset` (for example, `-o :end`) to stop at a specific offset.

// end::single-source[]
Loading