topic offsets
kafka topic offsets <topic>
Show partition offsets for a topic
Arguments
| Argument | Description |
|---|---|
topic |
topic name |
Shared options and defaults: connection profiles, JSON output, logging and help.
Defaults
The selected offset query controls whether the result is a single offset or low/high offsets per partition.
Flags
| Flag | Description |
|---|---|
--brokers <string> |
comma-separated broker list, e.g. localhost:9092 |
--time <string> |
resolve offsets as of “earliest”, “latest”, “max-timestamp”, or a millisecond timestamp |
Examples
kafka topic offsets orders --brokers localhost:9092
kafka topic offsets orders --time earliest --brokers localhost:9092
kafka topic offsets orders --time 1735689600000 --brokers localhost:9092
Output
Illustrative, abbreviated output. Empty arrays show the result envelope; actual entries, identifiers, optional fields and broker errors depend on the request and cluster.
With --json:
{
"partitions": [
{
"partition": 0,
"offset": "42"
}
]
}
Declared exit codes: 0, 1, 2. See the exit-code reference for meanings.