Skip to content

Mask field in nested object #685

Answered by philsttr
kerruba-milkman asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kerruba-milkman

Masking is not designed to work with Markers.appendRaw. When using Markers.appendRaw, an application takes full responsibility for providing the exact JSON to output. In other words, logstash-logback-encoder does not process the value passed to appendRaw at all.

You have a couple of options to get masking working...

Option 1: Instead of using appendRaw, let logstash-logback-encoder serialize the value by passing an object or array to one of the other append* methods. This will cause logstash-logback-encoder to serialize the object/array to JSON. It is during this serialization process that masking occurs.

Option 2: Use MaskingJsonGenerator to generate the masked value …

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kerruba-milkman
Comment options

You must be logged in to vote
1 reply
@philsttr
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants