Cloud

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.

Usage

rpk cluster connections list [flags]

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

--client-id

string

Filter results by the client ID.

--client-software-name

string

Filter results by the client software name.

--client-software-version

string

Filter results by the client software version.

--filter-raw

string

Filter connections based on a raw query (overrides other filters).

--format

string

Output format (json,yaml,text,wide,help).

-g, --group-id

string

Filter by client group ID.

-i, --idle-ms

int64

Show connections idle for more than i milliseconds.

--ip-address

string

Filter results by the client ip address.

--limit

int32

Limit how many records can be returned.

--order-by

string

Order the results by their values. See Examples above.

-s, --state

string

Filter results by state. Acceptable values: OPEN, CLOSED.

-u, --user

string

Filter results by a specific user principal.

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.