@@ -7,18 +7,22 @@ RedisShake provides various built-in filter rules that users can choose from acc
7
7
## Filtering Keys
8
8
RedisShake supports filtering by key name, key name prefixes, and suffixes. You can set the following options in the configuration file, for example:
9
9
``` toml
10
+ [filter ]
10
11
allow_keys = [" user:1001" , " product:2001" ] # allowed key names
11
12
allow_key_prefix = [" user:" , " product:" ] # allowed key name prefixes
12
13
allow_key_suffix = [" :active" , " :valid" ] # allowed key name suffixes
14
+ allow_key_regex = [" :\\ d{11}:" ] # allowed key name regex, 11-digit mobile phone number
13
15
block_keys = [" temp:1001" , " cache:2001" ] # blocked key names
14
16
block_key_prefix = [" temp:" , " cache:" ] # blocked key name prefixes
15
17
block_key_suffix = [" :tmp" , " :old" ] # blocked key name suffixes
18
+ block_key_regex = [" :test:\\ d{11}:" ] # blocked key name regex, 11-digit mobile phone number with "test" prefix
16
19
```
17
20
If these options are not set, all keys are allowed by default.
18
21
19
22
## Filtering Databases
20
23
You can specify allowed or blocked database numbers, for example:
21
24
``` toml
25
+ [filter ]
22
26
allow_db = [0 , 1 , 2 ]
23
27
block_db = [3 , 4 , 5 ]
24
28
```
@@ -27,6 +31,7 @@ If these options are not set, all databases are allowed by default.
27
31
## Filtering Commands
28
32
RedisShake allows you to filter specific Redis commands, for example:
29
33
``` toml
34
+ [filter ]
30
35
allow_command = [" GET" , " SET" ]
31
36
block_command = [" DEL" , " FLUSHDB" ]
32
37
```
@@ -37,6 +42,7 @@ You can also filter by command groups. Available command groups include:
37
42
SERVER, STRING, CLUSTER, CONNECTION, BITMAP, LIST, SORTED_SET, GENERIC, TRANSACTIONS, SCRIPTING, TAIRHASH, TAIRSTRING, TAIRZSET, GEO, HASH, HYPERLOGLOG, PUBSUB, SET, SENTINEL, STREAM
38
43
For example:
39
44
``` toml
45
+ [filter ]
40
46
allow_command_group = [" STRING" , " HASH" ]
41
47
block_command_group = [" SCRIPTING" , " PUBSUB" ]
42
48
```
0 commit comments