Getting Data In

How to mask the verificaition code using props and transforms

abhi04
Communicator

How can I mask the verfiication code using props/transforms?

{"body": " Verification Code: 123456",

 

I want to mask the code using props and transforms using below format, not sure how the search spl regex is different than regex in transforms

props.conf

[source::abc]
TRANSFORMS-anonymize = abc-anonymizer

transforms.conf
[abc-anonymizer]
DEST_KEY = _raw
REGEX = 
FORMAT = $1######$2

 

 

 

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Why use both props AND transforms when you can do it with just props?

[source::abc]
SEDCMD-anonymizer = s/Verification Code: \d+"/Verification Code: ######/g
---
If this reply helps you, Karma would be appreciated.

View solution in original post

abhi04
Communicator

Thanks @richgalloway  and @gcusello 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @abhi04 ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @abhi04 ,

I usually use the solution with SEDCMD hinted by @richgalloway .

Anyway, also the solution with props amd transforms should run:

props.conf

[source::abc]
TRANSFORMS-anonymize = abc-anonymizer

transforms.conf
[abc-anonymizer]
DEST_KEY = _raw
REGEX = Verification Code:\d+ 
FORMAT = Verification Code:######

Ciao.

Giuseppe

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Why use both props AND transforms when you can do it with just props?

[source::abc]
SEDCMD-anonymizer = s/Verification Code: \d+"/Verification Code: ######/g
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...