kafkatopic list
Lists existing Kafka topics.
Syntax
IMPORTANT
Ensure that the mapr-kafka
package is installed
on the server node, before running the kafkatopic list
command.
When mapr-kafka
package is not installed, the following error is
encountered: Command execution failed! 'kafkatopic' commands requires
'mapr-kafka' package.
- CLI
-
The maprcli command lists existing Kafka topics in a cluster/fabric.
$ maprcli kafkatopic list [-topicregex <regular expression>]
- REST
-
http[s]://<host>:<port>/rest/kafkatopic/list
Parameters
Parameter | Description |
---|---|
-topicregex |
regular expression to filter topic names for topic listing. This is an optional parameter. |
Examples
Verify the existing topics with the maprcli kafkatopic list
command.
$ maprcli kafkatopic list
owner partitions volume size topic compression ttl
root 1 false 100 day_temp lz4 604800
root 4 false 256 nght_temp off 604800
List topics with name starting with dayT
.
NOTE
Use single quotes or double quotes to enclose special Linux shell characters
such as . or * on the command line. The kafkatopic list
command
returns inaccurate results if you use special Linux shell characters in the
regular expression, without enclosing the regular expression in quotes.$ maprcli kafkatopic list -topicregex "dayT.*"
owner partitions ownvolume size topic compression ttl
root 1 false 20 dayTemp2305 lz4 604800
root 1 false 20 dayTemp2405 lz4 604800
root 1 false 20 dayTemp2505 lz4 604800
root 1 false 20 dayTemp2605 lz4 604800
root 1 false 20 dayTemp2705 lz4 604800