|
| 1 | += rpk cluster connections list |
| 2 | + |
| 3 | +Display statistics about current Kafka connections. |
| 4 | + |
| 5 | +This command displays a table of active and recently closed connections within the cluster. |
| 6 | + |
| 7 | +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. |
| 8 | + |
| 9 | +In addition to the 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 [ListKafkaConnections endpoint](https://docs.redpanda.com/api/doc/admin/version/11f41833-5783-4f1a-ad64-5957267abd52/operation/operation-redpanda-core-admin-v2-clusterservice-listkafkaconnections): |
| 10 | + |
| 11 | +By default only a subset of the per-connection data is printed. To see all of the available data, use `--format=json`. |
| 12 | + |
| 13 | +== Usage |
| 14 | + |
| 15 | +[,bash] |
| 16 | +---- |
| 17 | +rpk cluster connections list [flags] |
| 18 | +---- |
| 19 | + |
| 20 | +== Examples |
| 21 | + |
| 22 | +List connections ordered by their recent produce throughput: |
| 23 | + |
| 24 | +[,bash] |
| 25 | +---- |
| 26 | +rpk cluster connections list --order-by="recent_request_statistics.produce_bytes desc" |
| 27 | +---- |
| 28 | + |
| 29 | +List connections ordered by their recent fetch throughput: |
| 30 | + |
| 31 | +[,bash] |
| 32 | +---- |
| 33 | +rpk cluster connections list --order-by="recent_request_statistics.fetch_bytes desc" |
| 34 | +---- |
| 35 | + |
| 36 | +List connections ordered by the time that they've been idle: |
| 37 | + |
| 38 | +[,bash] |
| 39 | +---- |
| 40 | +rpk cluster connections list --order-by="idle_duration desc" |
| 41 | +---- |
| 42 | + |
| 43 | +List connections ordered by those that have made the least requests: |
| 44 | + |
| 45 | +[,bash] |
| 46 | +---- |
| 47 | +rpk cluster connections list --order-by="total_request_statistics.request_count asc" |
| 48 | +---- |
| 49 | + |
| 50 | +List extended output for open connections in JSON format: |
| 51 | + |
| 52 | +[,bash] |
| 53 | +---- |
| 54 | +rpk cluster connections list --format=json --state="OPEN" |
| 55 | +---- |
| 56 | + |
| 57 | +== Flags |
| 58 | + |
| 59 | +[cols="1m,1a,2a"] |
| 60 | +|=== |
| 61 | +|*Value* |*Type* |*Description* |
| 62 | + |
| 63 | +|--client-id |string |Filter results by the client ID. |
| 64 | + |
| 65 | +|--client-software-name |string |Filter results by the client software name. |
| 66 | + |
| 67 | +|--client-software-version |string |Filter results by the client software version. |
| 68 | + |
| 69 | +|--filter-raw |string |Filter connections based on a raw query (overrides other filters). |
| 70 | + |
| 71 | +|--format |string |Output format. Possible values: `json`, `yaml`, `text`, `wide`, `help`. Default: `text`. |
| 72 | + |
| 73 | +|-g, --group-id |string |Filter by client group ID. |
| 74 | + |
| 75 | +|-h, --help |- |Help for connections list. |
| 76 | + |
| 77 | +|-i, --idle-ms |int |Show connections idle for more than `i` milliseconds. |
| 78 | + |
| 79 | +|--ip-address |string |Filter results by the client IP address. |
| 80 | + |
| 81 | +|--limit |int32 |Limit how many records can be returned (default `20`). |
| 82 | + |
| 83 | +|--order-by |string |Order the results by their values. See <<examples>>. |
| 84 | + |
| 85 | +|-s, --state |string |Filter results by state. Acceptable values: `OPEN`, `CLOSED`. |
| 86 | + |
| 87 | +|-u, --user |string |Filter results by a specific user principal. |
| 88 | + |
| 89 | +|--config |string |Redpanda or `rpk` config file; default search paths are `/var/lib/redpanda/.config/rpk/rpk.yaml`, `$PWD/redpanda.yaml`, and `/etc/redpanda/redpanda.yaml`. |
| 90 | + |
| 91 | +|-X, --config-opt |stringArray |Override `rpk` configuration settings. See xref:reference:rpk/rpk-x-options.adoc[`rpk -X`] or execute `rpk -X help` for inline detail or `rpk -X list` for terser detail. |
| 92 | + |
| 93 | +|--profile |string |Profile to use. See xref:reference:rpk/rpk-profile.adoc[`rpk profile`] for more details. |
| 94 | + |
| 95 | +|-v, --verbose |- |Enable verbose logging. |
| 96 | +|=== |
0 commit comments