# rpk topic analyze

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: rpk topic analyze
latest-redpanda-tag: v25.3.11
latest-console-tag: v3.7.3
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: November 19, 2026
latest-connect-version: 4.93.0
docname: rpk/rpk-topic/rpk-topic-analyze
page-component-name: streaming
page-version: "25.3"
page-component-version: "25.3"
page-component-title: Streaming
page-relative-src-path: rpk/rpk-topic/rpk-topic-analyze.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/v/25.3/modules/reference/pages/rpk/rpk-topic/rpk-topic-analyze.adoc
description: rpk topic analyze
page-git-created-date: "2025-04-07"
page-git-modified-date: "2025-04-07"
support-status: supported
---

<!-- Source: https://docs.redpanda.com/streaming/25.3/reference/rpk/rpk-topic/rpk-topic-analyze.md -->

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)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)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`, and `t1` is a timestamp, then `t2` is relative to `t1`.

-   If a duration is used for `t2`, and `t1` is a duration, then `t2` is 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

## [](#usage)Usage

```bash
rpk topic analyze [TOPIC] [flags]
```

## [](#flags)Flags

| Value | Type | Description |
| --- | --- | --- |
| --batches | int | Minimum number of batches to consume per partition (default 10). |
| --format | string | Output format (json,yaml,text,wide,help) (default text). |
| -h, --help | - | Help for the analyze subcommand. |
| -a, --print-all | - | Print all sections. |
| --print-partition-batch-rate | - | Print the detailed partitions batch rate section. |
| --print-partition-batch-size | - | Print the detailed partitions batch size section. |
| -s, --print-summary | - | Print the summary section. |
| --print-topics | - | Print the topics section. |
| -r, --regex | - | Parse arguments as regex. Analyze any topic that matches any input topic expression. |
| -t, --time-range | string | Time range to consume from (-24h:end, -48h:-24h, 2022-02-14:1h) (default -1m:end). |
| --timeout | duration | Specifies how long the command should run before timing out (default 10s). |
| --config | string | Redpanda or rpk configuration file. Default search paths are /var/lib/redpanda/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml. |
| -X, --config-opt | stringArray | Override rpk configuration settings. Use -X help for more details or -X list for terser detail. |
| --profile | string | rpk profile to use. |
| -v, --verbose | - | Enable verbose logging. |