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
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.
Hi @brenuart how are you?
I got the solution passing the path like this: /array/*/foo
So my logback.xml was like below:
<jsonGeneratorDecorator class="net.logstash.logback.mask.MaskingJsonGeneratorDecorator">
<!-- The default mask string can optionally be specified by <defaultMask>.
When the default mask string is not specified, **** is used.
-->
<defaultMask>****</defaultMask>
<!-- Field paths to mask added via <path> will use the default mask string -->
<path>foo</path>
<path>array/*/foo</path>
</jsonGeneratorDecorator>
Suppose a configuration that produces the following JSON:
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:Unfortunately this doesn't work and nothing is masked. To recap the observed behaviour:
/array
Result:
{ "array": "****" }
/array/1
Result:
"{ array": ["a", {"foo":"bar"}] }
Expected:
"{ array": ["a", "****"] }
/array/1/foo
Result:
"{ array": ["a", {"foo":"****"}] }
logstash-logback-encoder: 7.0.1
The text was updated successfully, but these errors were encountered: