Regex to mask the JSON Value
HI Team,,
I tried many ways to mask the PII Data by using regex, but Sumo is not accepting normal regex queries.
I want to mask the field if key contains as string. for example,
{
"primaryEmail" : "abc@domain.com"
}
Now i want to mask the value like below
{
"primaryEmail" : ####
}
-
Official comment
Expressions that you want masked must be expressed as a capture group in the regex. Capture groups are identified with enclosed parentheses
().
Here try this regular expression.
primaryEmail\" : \"(.*)\"
Comment actions -
Thanks a lot @Nathan. sorry my bad actually we may get email address key in different formats. Say
{
"PrimaryEmail" : ""abc@domain.com"
}
{
"EmailAddress" : "abc@domain.com"
}{
"emailAddress" : "abc@domain.com"
}many formats. sometime camelCase and sometimes complete in capitals etc.
My ultimate goal is to mask the value if key contains "email" or "mail"
Thanks,
NaGG
Please sign in to leave a comment.
Comments
3 comments