cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sensitive data masking

marusla
Participant

Hello, can someone helpme, please, im trying to create an Search expression for hide some fields, like passport, id, an only showme the last 4 digit, can you helpme im trying with (.{4}) but this hide only the first 4 digit, but i want that showme the last 4

Here an examble of my log

Id/:124241244, Passport/:34455009986665

I want masking the number an show only de last 4 digit like:

Id/:*1244, Passport/:*6665

1 REPLY 1

juan_mesa
Dynatrace Advocate
Dynatrace Advocate

Hi Marusla,

Dynatrace’s sensitive data masking feature uses a simplified regular expression engine that doesn’t support advanced constructs such as lookaheads, lookbehinds, or backreferences those would help us to achieve the outcome you are desiring. Only standard expressions are supported — for example, you can safely mask entire numeric fields using a pattern such as:

(?:Id/:|Passport/:)(\d+)

This will replace the full number according the format you use for data masking type, in the example below I use the string format.

I believe that if you need to keep the last four digits visible, the masking must be applied before logs are sent to Dynatrace.

Hope this helps,

Best regards

Featured Posts