Getting Data In

Anonymize Multiple Data Points in Splunk Search

markhvesta
Path Finder

I am trying to anonymize customer credit card data in splunk logs but when more than one card appears in the same event only one is scrubbed.

transforms on the indexers:

[SEDCMD-anonymizecc]
REGEX =  s/(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})/###SCRUBBED###/g
FORMAT= $1###SCRUBBED###$2
REPEAT_MATCH = true
LOOKAHEAD = 800

Sample event:

2019-08-27 13:31:00,002 -0700 DEBUG -
Sent Message HTTP POST
Elapsed time : 0.007166 (seconds)
ContentType : application/x_www_form_urlencoded
Request : Amount = 528.01
CardNumber = CARDNUMBER
PaymentDeviceOnFileID =
ResponseCode = 0
Request Buffer : Amount=528.01&CardNumber=CARDNUMBER&PaymentDeviceOnFileID=##NULL##
Response Buffer : ResponseCode=0

0 Karma

harsmarvania57
SplunkTrust
SplunkTrust

Hi,

You can use SEDCMD in props.conf to achieve this easily at Index time, compare to combination of props and transforms.

Please try below config

props.conf

[yourSourcetype]
SEDCMD-Anon = s/(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})/###SCRUBBED###/g
0 Karma

markhvesta
Path Finder

I just tried this and it is only masking the second instance and not the first in the event.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...