OnCallReadyStart learning

kafka-consumer-groups.sh: list, describe, reset and delete consumer groups

kafka-consumer-groups.sh [options]

Options you will use

--bootstrap-server <String: server to connect to>
REQUIRED: the Kafka broker(s) to connect to, host:port[,host:port]. Give more than one: the first may be the broker that is down.
--command-config <String: config file>
a properties file with client configs for the admin client (TLS, SASL...).
--list
list all consumer groups.
--describe
offsets and lag per partition (CURRENT-OFFSET, LOG-END-OFFSET, LAG, CONSUMER-ID, HOST, CLIENT-ID).
--members
with --describe: the members and how many partitions each has (--verbose: which ones).
--state
with --describe: coordinator, assignment strategy, state, number of members.
--verbose
with --describe --members: the partitions each member owns (and epochs with the consumer protocol).
--type [String: type]
with --list: show (or filter by) the group type: classic, consumer, share, streams.
--group <String: group>
the consumer group.
--all-groups
every group.
--reset-offsets
reset the group's offsets.
--to-earliest
to the first offset still in the log.
--to-latest
to the end of the log.
--to-offset <Long>
to this offset (clamped to the log's range with a WARN).
--shift-by <Long>
move the current offset by n (negative = back).
--to-datetime <String>
to the first offset at or after YYYY-MM-DDThh:mm:ss.SSS (UTC unless a zone is given; the milliseconds are required).
--by-duration <String>
to the first offset at or after now minus an ISO-8601 duration (PT30M).
--to-current
to the current offset (with --export: a backup).
--from-file <String: csv>
to the offsets in a CSV (topic,partition,offset).
--export
print the plan as CSV.
--dry-run
only show the result (the default today).
--execute
really change the offsets.
--topic <String: topic[:partitions]>
the scope of a reset: a topic or topic:0,2.
--all-topics
every topic the group has offsets for.
--delete
delete the group (must be Empty).

Examples

$ kafka-consumer-groups.sh --bootstrap-server kafka-1:9092 --describe --group billing

lag per partition

$ kafka-consumer-groups.sh --bootstrap-server kafka-1:9092 --group billing --reset-offsets --topic orders --to-datetime 2026-09-22T18:00:00.000 --execute

replay from a time

Gotchas

Taught in

On the blog

Try kafka-consumer-groups.sh in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.