Replies: 1 comment
-
You'll need to use a value masker (as opposed to a path masker) if you want to mask based on field values. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using structured logging design to log data. When logging a particular data i would like to mask using predicate in json pointer. For eg:
log.info("Printing greeting detail object received in request",greeting);
{"@timestamp":"2024-03-12 10:18:06,297","severity":"INFO","service":"Demo Application Service","class":"c.e.reactivewebservice.GreetingHandler","message":{"text":"Printing greeting detail object received in request ","details":{"Greeting":{"message":"Welcome to Phuket","name":"John","age":"26","world":{"name":null,"geoName":"phuk","geography":null,"longitude":230,"lat":400},"markets":[{"marketName":"spa","location":"mum","gstNo":"2345666"},{"marketName":"bugis","location":"sing","gstNo":"2245680087"},{"marketName":"flower","location":"washdc","gstNo":"112367886433"}]}}},"thread":"reactor-http-nio-6","pid":"29416","correlation-id":"","trace":""}
I am using logback.xml in which i am using MaskingJsonGeneratorDecorator, defining path
/message/details/Greeting/name ---- this will mask name field (irrespective of value)
/message/details/Greeting/age -- this will mask age field (similar to above)
I have requirement if field value contains 'null' then it should not mask (how to do this? As current class masks irrespective of value), is it possible to apply predicate /message/details/Greeting[@.name != 'null']/name --- Kindly let me know how to apply predicate or help me create custom masking component which i can apply to get the predicate support
Beta Was this translation helpful? Give feedback.
All reactions