Getting Data In

Problem anonymizing data in Splunk

justynap_ldz
Path Finder

We want to anonymize the usernames in the following event using sed script.

Raw event:

{"externalId": null, "statusChanged": "2021-02-09T09:51:42.000Z", "userName": "thisisatestuser@123.pl ", "appid": "0oa97rn2ymPrbgM430x612344", "lastUpdated": "2021-02-09T09:51:42.000Z", "scope": "", "userid": "00u1a2mn8ouOvSO2A0x71234", "created": "2021-02-09T09:51:42.000Z", "status": "ACTIVE"}

However, either the stanza in props.conf is incorrect or we did it in the wrong place.

Current config:
1. input is specified on a Heavy Forwarder in an app local folder (we just activated inputs after installing an app in the FrontEnd and that is how this entry was created)
2. we added the following SEDCMD stanza in /opt/splunk/etc/system/local/props.conf on a Heavy Forwarder: 

[testapp:appUser]
SEDCMD-TestApp_username1=s/userName:(\d{6})/userName:XXXXXX/1

Does anyone have any idea on how to solve it?

0 Karma

to4kawa
Ultra Champion
index=_internal | head 1 | fields _raw
| eval _raw="{\"externalId\": null, \"statusChanged\": \"2021-02-09T09:51:42.000Z\", \"userName\": \"thisisatestuser@123.pl \", \"appid\": \"0oa97rn2ymPrbgM430x612344\", \"lastUpdated\": \"2021-02-09T09:51:42.000Z\", \"scope\": \"\", \"userid\": \"00u1a2mn8ouOvSO2A0x71234\", \"created\": \"2021-02-09T09:51:42.000Z\", \"status\": \"ACTIVE\"}"
| rex mode=sed "s/(userName\":\s*\").*@/\1XXXXXX@/"

your SEDCMD is wrong.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your user name looks like an e-mail address whereas your sed is looking for 6 digits.

0 Karma
Get Updates on the Splunk Community!

Why You Can't Miss .conf25: Unleashing the Power of Agentic AI with Splunk & Cisco

The Defining Technology Movement of Our Lifetime The advent of agentic AI is arguably the defining technology ...

Deep Dive into Federated Analytics: Unlocking the Full Power of Your Security Data

In today’s complex digital landscape, security teams face increasing pressure to protect sprawling data across ...

Your summer travels continue with new course releases

Summer in the Northern hemisphere is in full swing, and is often a time to travel and explore. If your summer ...