|
1 | 1 | The `CLIENT LIST` command returns information and statistics about the client
|
2 | 2 | connections server in a mostly human readable format.
|
3 | 3 |
|
4 |
| -You can use one of the optional subcommands to filter the list. The `TYPE type` subcommand filters the list by clients' type, where *type* is one of `normal`, `master`, `replica`, and `pubsub`. Note that clients blocked by the `MONITOR` command belong to the `normal` class. |
| 4 | +You can use one or more optional arguments to filter the list: |
5 | 5 |
|
6 |
| -The `ID` filter only returns entries for clients with IDs matching the `client-id` arguments. |
| 6 | +- **`TYPE type`**: Filters the list by clients' type, where *type* is one of `normal`, `master`, `replica`, and `pubsub`. |
| 7 | + > Note: Clients blocked by the `MONITOR` command belong to the `normal` class. |
| 8 | +
|
| 9 | +- **`ID client-id [client-id ...]`**: Returns entries for clients with IDs matching one or more `client-id` arguments. |
| 10 | + |
| 11 | +- **`USER user`**: Filters the list to include only clients authenticated as the specified user. |
| 12 | + |
| 13 | +- **`ADDR ip:port`**: Filters the list to include only clients connected from the specified address and port. |
| 14 | + |
| 15 | +- **`LADDR ip:port`**: Filters the list to include only clients connected to the specified local address and port. |
| 16 | + |
| 17 | +- **`SKIPME yes|no`**: Filters whether the list should skip the client making the request. |
| 18 | + - `yes`: Skips the client making the request. |
| 19 | + - `no`: Includes the client making the request. |
| 20 | + |
| 21 | +- **`MAXAGE milliseconds`**: Filters the list to include only clients whose connection age (time since the client was created) is greater than or equal to the specified number of milliseconds. |
| 22 | + > Note: This is actually a minimum age, not a maximum age. This filter was first added to CLIENT KILL, where the intention was to keep clients of a maximum age and kill the ones than the max age. |
| 23 | +
|
| 24 | +Filters can be combined to perform more precise searches. The command will handle multiple filters via logical AND. |
7 | 25 |
|
8 | 26 | Here is the meaning of the fields:
|
9 | 27 |
|
@@ -72,6 +90,12 @@ r: the client socket is readable (event loop)
|
72 | 90 | w: the client socket is writable (event loop)
|
73 | 91 | ```
|
74 | 92 |
|
| 93 | +## Examples |
| 94 | + |
| 95 | +```bash |
| 96 | +CLIENT LIST TYPE normal USER admin MAXAGE 5000 ID 1234 5678 |
| 97 | +``` |
| 98 | + |
75 | 99 | ## Notes
|
76 | 100 |
|
77 | 101 | New fields are regularly added for debugging purpose. Some could be removed
|
|
0 commit comments