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. By default only a subset of the per-connection data is printed. To see all of the available data, use --format=json.
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.
Examples
This section provides examples of how to use rpk cluster connections list.
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 ( |
|
string |
Filter by client group ID. |
|
int64 |
Show connections idle for more than i milliseconds. |
|
string |
Filter results by the client ip address. |
|
int32 |
Limit how many records can be returned. |
|
string |
Order the results by their values. See Examples above. |
|
string |
Filter results by state. Acceptable values: |
|
string |
Filter results by a specific user principal. |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |