Open
Description
Suppose a configuration that produces the following JSON:
{
"array": ["a", {"foo":"bar"}]
}
If you want to mask the second array entry you should configure a MaskingJsonGeneratorDecorator with a PathMask of /array/1
. This should produce the following result:
{
"array": ["a", "****"]
}
Unfortunately this doesn't work and nothing is masked. To recap the observed behaviour:
PathMask | Comment |
---|---|
/array |
Path points to the array field whose content is entirely masked. Result: { "array": "****" } |
/array/1 |
Path points to the second array entry BUT nothing is masked. Result: "{ array": ["a", {"foo":"bar"}] } Expected: "{ array": ["a", "****"] } |
/array/1/foo |
Path points to the foo property of the second entry which is masked. This shows that a path can correctly identify an array entry by its index. Result: "{ array": ["a", {"foo":"****"}] } |
logstash-logback-encoder: 7.0.1