rpk cluster connections list
Display statistics about current Kafka connections.
This command displays a table of active and recently closed connections within the cluster.
Use filtering and sorting to identify the connections of the client applications that you are interested in. See --help for the list of filtering arguments and sorting arguments.
In addition to filtering shorthand CLI arguments (For example, --client-id, --state), you can also use the --filter-raw and --order-by arguments that take string expressions. To understand the syntax of these arguments, refer to the Admin API docs of the filter and order-by fields of the GET /v1/monitoring/kafka/connections Data Plane API endpoint.
By default only a subset of the per-connection data is printed. To see all of the available data, use --format=json.
Examples
List connections ordered by their recent produce throughput:
rpk cluster connections list --order-by="recent_request_statistics.produce_bytes desc"
List connections ordered by their recent fetch throughput:
rpk cluster connections list --order-by="recent_request_statistics.fetch_bytes desc"
List connections ordered by the time that they’ve been idle:
rpk cluster connections list --order-by="idle_duration desc"
List connections ordered by those that have made the least requests:
rpk cluster connections list --order-by="total_request_statistics.request_count asc"
List extended output for open connections in JSON format:
rpk cluster connections list --format=json --state="OPEN"
Flags
| Value | Type | Description |
|---|---|---|
|
string |
Filter results by the client ID. |
|
string |
Filter results by the client software name. |
|
string |
Filter results by the client software version. |
|
string |
Filter connections based on a raw query (overrides other filters). |
|
string |
Output format. Possible values: |
|
string |
Filter by client group ID. |
|
- |
Help for connections list. |
|
int |
Show connections idle for more than |
|
string |
Filter results by the client IP address. |
|
int32 |
Limit how many records can be returned (default |
|
string |
Order the results by their values. See Examples. |
|
string |
Filter results by state. Acceptable values: |
|
string |
Filter results by a specific user principal. |
|
string |
Redpanda or |
|
stringArray |
Override |
|
string |
Profile to use. See |
|
- |
Enable verbose logging. |