rpk topic analyze
Analyze topics.
This command consumes records from the specified topics to determine topic characteristics, such as batch rate and batch size.
Use the --format flag with either JSON or YAML to print all of the metadata collected.
Specify topics
List individual topics or use the --regex flag (-r) for filtering.
For example,
analyze logins transactions # analyze topics logins and transactions analyze -r '^l.*' '.*s$' # analyze all topics starting with l and all topics ending in s analyze -r '*' # analyze all topics analyze -r . # analyze any one-character topics
Time range
Use the --time-range flag to specify the time range from which to consume records. Use the following format:
t1:t2 consume from timestamp t1 until timestamp t2
There are a few options for the timestamp syntax. rpk evaluates each option
until one succeeds:
13 digits parsed as a Unix millisecond 9 digits parsed as a Unix second YYYY-MM-DD parsed as a day, UTC YYYY-MM-DDTHH:MM:SSZ parsed as RFC3339, UTC; fractional seconds optional (.MMM) end for t2 in @t1:t2, the current end of the partition -dur a negative duration from now or from a timestamp dur a positive duration from now or from a timestamp
Durations can be relative to the current time or relative to a timestamp.
-
If a duration is used for
t1, that duration is relative to now. -
If a duration is used for
t2, andt1is a timestamp, thent2is relative tot1. -
If a duration is used for
t2, andt1is a duration, thent2is relative to now.
Durations are parsed simply:
3ms three milliseconds 10s ten seconds 9m nine minutes 1h one hour 1m3ms one minute and three milliseconds
For example:
-t 2022-02-14:1h consume 1h of time on Valentine's Day 2022 -t -48h:-24h consume from 2 days ago to 1 day ago -t -1m:end consume from 1m ago until now
Flags
| Value | Type | Description |
|---|---|---|
|
int |
Minimum number of batches to consume per partition (default |
|
string |
Output format ( |
|
- |
Help for the analyze subcommand. |
|
- |
Print all sections. |
|
- |
Print the detailed partitions batch rate section. |
|
- |
Print the detailed partitions batch size section. |
|
- |
Print the summary section. |
|
- |
Print the topics section. |
|
- |
Parse arguments as regex. Analyze any topic that matches any input topic expression. |
|
string |
Time range to consume from ( |
|
duration |
Specifies how long the command should run before timing out (default |
|
string |
Redpanda or rpk configuration file. Default search paths are |
|
stringArray |
Override rpk configuration settings. Use |
|
string |
rpk profile to use. |
|
- |
Enable verbose logging. |