From dc130d07d756ce8810db637c61fcac09e34638df Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Fri, 1 Aug 2025 11:57:07 +0800 Subject: [PATCH 1/2] add docs for negative client filter Signed-off-by: zhaozhao.zz --- commands/client-kill.md | 12 ++++++++++++ commands/client-list.md | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/commands/client-kill.md b/commands/client-kill.md index e703e4141..c85c0bc23 100644 --- a/commands/client-kill.md +++ b/commands/client-kill.md @@ -26,6 +26,18 @@ instead of killing just by address. The following filters are available: * `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. +* `CLIENT KILL NOT-ID client-id [client-id ...]`. Kill clients are not in the IDs set. +* `CLIENT KILL NOT-TYPE type`. Kill clients are not in the specified type. +* `CLIENT KILL NOT-ADDR ip:port`. Kill clients except the specified ip and port. +* `CLIENT KILL NOT-LADDR ip:port`. Kill all clients not connected to specified local (bind) address. +* `CLIENT KILL NOT-USER username`. Closes all the connections that are not authenticated with the specified [ACL](../topics/acl.md) username. +* `CLIENT KILL NOT-FLAGS flags`. Kill clients not with the specified flag string. +* `CLIENT KILL NOT-NAME name`. Kill clients not with the specified name. +* `CLIENT KILL NOT-LIB-NAME lib-name`. Kill clients not using the specified library name. +* `CLIENT KILL NOT-LIB-VER lib-version`. Kill clients not with the specified library version. +* `CLIENT KILL NOT-DB db`. Kill clients not with the specified database ID. +* `CLIENT KILL NOT-CAPA capa`. Kill clients not with the specified capabilities. +* `CLIENT KILL NOT-IP ip`. Kill clients not with the specified IP address. It is possible to provide multiple filters at the same time. The command will handle multiple filters via logical AND. For example: diff --git a/commands/client-list.md b/commands/client-list.md index c8ed044fb..9f9f89f91 100644 --- a/commands/client-list.md +++ b/commands/client-list.md @@ -37,6 +37,30 @@ You can use one or more optional arguments to filter the list: - **`CAPA capa`**: Filters the list to include only clients with the specified capabilities. +- **`NOT-ID client-id [client-id ...]`**: Excludes clients in the IDs set. + +- **`NOT-TYPE`**: Excludes clients of the specified type. + +- **`NOT-ADDR`**: Excludes clients of the specified address and port. + +- **`NOT-LADDR`**: Excludes clients connected to the specified local address and port. + +- **`NOT-USER`**: Excludes clients of the specified user. + +- **`NOT-FLAGS`**: Excludes clients with the specified flag string. + +- **`NOT-NAME`**: Excludes clients with the specified name. + +- **`NOT-LIB-NAME`**: Excludes clients using the specified library name. + +- **`NOT-LIB-VER`**: Excludes clients with the specified library version. + +- **`NOT-DB`**: Excludes clients with the specified database ID. + +- **`NOT-CAPA`**: Excludes clients with the specified capabilities. + +- **`NOT-IP`**: Excludes clients with the specified IP address. + 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: From c3a61a1995e05775a595d1b0152f16f897bd1685 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Mon, 8 Sep 2025 14:54:10 +0800 Subject: [PATCH 2/2] Update commands/client-list.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Viktor Söderqvist Signed-off-by: zhaozhao.zz --- commands/client-list.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/commands/client-list.md b/commands/client-list.md index 9f9f89f91..ccd996a78 100644 --- a/commands/client-list.md +++ b/commands/client-list.md @@ -39,27 +39,27 @@ You can use one or more optional arguments to filter the list: - **`NOT-ID client-id [client-id ...]`**: Excludes clients in the IDs set. -- **`NOT-TYPE`**: Excludes clients of the specified type. +- **`NOT-TYPE type`**: Excludes clients of the specified type. -- **`NOT-ADDR`**: Excludes clients of the specified address and port. +- **`NOT-ADDR ip:port`**: Excludes clients of the specified address and port. -- **`NOT-LADDR`**: Excludes clients connected to the specified local address and port. +- **`NOT-LADDR ip:port`**: Excludes clients connected to the specified local address and port. -- **`NOT-USER`**: Excludes clients of the specified user. +- **`NOT-USER user`**: Excludes clients of the specified user. -- **`NOT-FLAGS`**: Excludes clients with the specified flag string. +- **`NOT-FLAGS flags`**: Excludes clients with the specified flag string. -- **`NOT-NAME`**: Excludes clients with the specified name. +- **`NOT-NAME name`**: Excludes clients with the specified name. -- **`NOT-LIB-NAME`**: Excludes clients using the specified library name. +- **`NOT-LIB-NAME lib-name`**: Excludes clients using the specified library name. -- **`NOT-LIB-VER`**: Excludes clients with the specified library version. +- **`NOT-LIB-VER lib-ver`**: Excludes clients with the specified library version. -- **`NOT-DB`**: Excludes clients with the specified database ID. +- **`NOT-DB db`**: Excludes clients with the specified database ID. -- **`NOT-CAPA`**: Excludes clients with the specified capabilities. +- **`NOT-CAPA capa`**: Excludes clients with the specified capabilities. -- **`NOT-IP`**: Excludes clients with the specified IP address. +- **`NOT-IP ip`**: Excludes clients with the specified IP address. Filters can be combined to perform more precise searches. The command will handle multiple filters via logical AND.