Skip to main content
Version: 22.2

rpk topic list

List topics, optionally listing specific topics.

This command lists all topics that you have access to by default. If specifying topics or regular expressions, this command can be used to know exactly what topics you would delete if using the same input to the delete command.

Alternatively, you can request specific topics to list, which can be used to check authentication errors (do you not have access to a topic you were expecting to see?), or to list all topics that match regular expressions.

The --regex or -r flag opts into parsing the input topics as regular expressions and listing any non-internal topic that matches any of expressions. The input expressions are wrapped with ^ and $ so that the expression must match the whole topic name. Regular expressions cannot be used to match internal topics, as such, specifying both -i and -r will exit with failure.

Lastly, --detailed or -d flag opts in to printing extra per-partition information.

Usage

rpk topic list [flags]

Aliases

list, ls

Flags

Value Type Description
-d, --detailed- Print per-partition information for topics.
-h, --help- Help for list.
-i, --internal- Print internal topics.
-r, --regex-Parse topics as regex; list any topic that matches any input topic expression.
--brokersstringsComma-separated list of broker <ip>:<port> pairs (for example,--brokers '192.168.78.34:9092,192.168.78.35:9092,192.179.23.54:9092'). Alternatively, you may set the REDPANDA_BROKERSenvironment variable with the comma-separated list of broker addresses.
--configstringRedpanda config file, if not set the file will be searched for in the default locations.
--passwordstring SASL password to be used for authentication.
--sasl-mechanismstringThe authentication mechanism to use. Supported values:SCRAM-SHA-256, SCRAM-SHA-512.
--tls-certstringThe certificate to be used for TLS authentication with the broker.
--tls-enabled-Enable TLS for the Kafka API (not necessary if specifying custom certs).
--tls-keystringThe certificate key to be used for TLS authentication with the broker.
--tls-truststorestring The truststore to be used for TLS communication with the broker.
--userstring SASL user to be used for authentication.
-v, --verbose-Enable verbose logging (default false).