Masking ecs logs

How do I mask Ecslayout based logs based on regex based logic? I am using log4j2 for logging purposes and the layout I am using is EcsLayout.

Consider following JSON object which I would be logging using log4j2 ecslayout console:

{
"id":"paymentID",
"email":"chiragnighut05@gmail.com",
"contact":"+919000000000"
}

Here I need to mask email and contact fields.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.