Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions commands/client-kill.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ instead of killing just by address. The following filters are available:
* `CLIENT KILL USER username`. Closes all the connections that are authenticated with the specified [ACL](../topics/acl.md) username, however it returns an error if the username does not map to an existing ACL user.
* `CLIENT KILL SKIPME yes/no`. By default this option is set to `yes`, that is, the client calling the command will not get killed, however setting this option to `no` will have the effect of also killing the client calling the command.
* `CLIENT KILL MAXAGE maxage`. Closes all the connections that are older than the specified age, in seconds.
* `CLIENT KILL FLAGS flags`. Kill only clients whose flag string includes the specified characters. Returns an error if valid flags are not used.
* `CLIENT KILL NAME name`. Kill clients with the specified name.
* `CLIENT KILL IDLE idle`. Kill only clients that have been idle for at least the specified time.
* `CLIENT KILL LIB-NAME lib-name`. Kill clients using the specified library name.
* `CLIENT KILL LIB-VER lib-version`. Kill clients running the specified library version.
* `CLIENT KILL DB db`. Kill clients operating on the specified database id.
* `CLIENT KILL IP ip`. Kill clients with the specified originating IP address.
* `CLIENT KILL CAPA capa`. Kill clients that have the specified capabilities.

It is possible to provide multiple filters at the same time. The command will handle multiple filters via logical AND. For example:

Expand Down
18 changes: 18 additions & 0 deletions commands/client-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ You can use one or more optional arguments to filter the list:
- **`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.
> 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 newer than the max age.

- **`FLAGS flags`**: Filters the list by the client's flag string.

- **`NAME name`**: Filters the list to include only clients with the specified name.

- **`IDLE idle`**: Includes only clients that have been idle for at least the specified time.

- **`LIB-NAME lib-name`**: Filters the list to include only clients using the specified library name.

- **`LIB-VER lib-ver`**: Filters the list to include only clients with the specified library version.

- **`DB db`**: Filters the list to include only clients with the specified database ID.

- **`IP ip`**: Filters the list to include only clients with the specified IP address.

- **`CAPA capa`**: Filters the list to include only clients with the specified capabilities.

Filters can be combined to perform more precise searches. The command will handle multiple filters via logical AND.

Here is the meaning of the fields:
Expand Down Expand Up @@ -101,6 +117,8 @@ w: the client socket is writable (event loop)

```bash
CLIENT LIST TYPE normal USER admin MAXAGE 5000 ID 1234 5678
id=1234 addr=127.0.0.1:64000 laddr=127.0.0.1:6379 fd=5 name= age=600 idle=300 flags= db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 tot-mem=1024 events=r cmd=client|list user=default redir=-1 resp=2 lib-name= lib-ver=
id=5678 addr=127.0.0.1:64001 laddr=127.0.0.1:6379 fd=6 name= age=900 idle=450 flags= db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 tot-mem=2048 events=r cmd=client|list user=default redir=-1 resp=2 lib-name= lib-ver=
```

## Notes
Expand Down