Splunk Search

How to mask the bank balance to be shown in splunk logs?

LBG_Ankit
New Member

Hi,
How can I mask the bank balance in splunk? it is showing something like this:

mybal=2426.88,availableBal=2426.88 and I need to replace numbers with #. Please suggest, I am not good in REGEX.

Thanks in advance.

Tags (2)
0 Karma
1 Solution

493669
Super Champion

try in props.conf:

[<your sourcetypeName>]
SEDCMD-Anon = s/mybal=\d+\.?\d+/mybal=xxxx/g s/availableBal=\d+\.?\d+/availableBal=xxxx/g

For reference https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata#Anonymize_data_with_a_sed_scr...
Here SEDCMD will mask the data at index time extraction

View solution in original post

0 Karma

493669
Super Champion

try in props.conf:

[<your sourcetypeName>]
SEDCMD-Anon = s/mybal=\d+\.?\d+/mybal=xxxx/g s/availableBal=\d+\.?\d+/availableBal=xxxx/g

For reference https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata#Anonymize_data_with_a_sed_scr...
Here SEDCMD will mask the data at index time extraction

0 Karma

LBG_Ankit
New Member

thank you it is working....:)

0 Karma

richgalloway
SplunkTrust
SplunkTrust

See the docs at http://docs.splunk.com/Documentation/Splunk/7.1.2/Data/Anonymizedata
A sed string like "s/(\d+.\d\d)/xxxx.xx/g" should work.

---
If this reply helps you, Karma would be appreciated.

LBG_Ankit
New Member

Thanks Rich..it is working for me...:)

0 Karma

somesoni2
Revered Legend

Or s/([bB]al\=)(\d+|\d+\.\d+)/\1##.##.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...