You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can control which fields are masked using the `-include` and `-exclude` flags, which both accept glob patterns (e.g., `user.*`, `session.ip_*`).
53
+
You can control which fields are masked using the `-include` and `-exclude` flags, which both accept glob patterns (e.g., `user.*`, `session.ip_*`, `**.email`, `user.*.id`). These patterns allow for flexible matching of field names and nested paths.
54
54
55
55
-**Default Behavior:** If no flags are used, all fields are masked.
56
56
-**Using `-include`:** Specifies which fields *should* be masked. When `-include` patterns are used, only fields matching them will be considered for masking.
57
57
-**Using `-exclude`:** Specifies fields that *should not* be masked, creating exceptions.
58
58
-**Combining Flags:** When used together, `-exclude` always takes precedence. A field is only masked if it matches an `-include` pattern but does *not* match an `-exclude` pattern. If only `-exclude` is used, all fields are masked *except* for those that match an exclusion pattern.
59
59
60
-
For example, given `data.json`:
61
-
```json
62
-
{
63
-
"user": {
64
-
"id": "aa1",
65
-
"personal_info": {
66
-
"subscriber": "uuid-123",
67
-
"name": "Jane Doe",
68
-
"email": "jane.doe@example.com"
69
-
}
70
-
},
71
-
"session": {
72
-
"ip_address": "198.51.100.22",
73
-
"timestamp": "2025-11-25T10:00:00Z"
74
-
}
75
-
}
76
-
```
77
-
78
-
**Goal:** Mask all sensitive user details and the session IP address, but leave the subscriber field untouched for reference.
The command first designates all fields under `user.personal_info` and `session.ip_address` for masking with the `-include` flags. Then, the `-exclude` flag creates an exception for `user.personal_info.subscriber`, preventing it from being masked even though it was matched by the include pattern.
0 commit comments