Splunk Search

How to edit my SEDCMD-mask regex on a heavy forwarder to mask a string in my sample data?

ssyed2009
New Member

Having issues using SEDCMD on Heavy forwarder layer. I have a complex REGEX with multiple pipes |||| But it is not working. I even tried without pipes (||) and one pattern but it still the same issue

SEDCMD-mask = s/\,{3}(\"[^\"]+\"|\w+\S[^,]|\"\W.+\"|\S[^,])\,/\,{3}(###)\,/g

Trying to mask "Accepted: FW: Global Fun Time (Feb. 11, 2011)"

2018-02-01T21:09:51.445Z,,ABC001.abc.abc.com,,ABC001,14321413285;2018-02-20T21:11:49.539Z;ClientSubmitTime:2019-02-20T21:03:46.000Z,,STOREDRIVER,DELIVER,22037477195836,<2dsadsa213421432141324dewdqe@SN6PR08MB5472.abc.prod.outlook.com>,b3213213c-ef2c-4096-ad06-08d69776e8c9,abc@abc.com,,32956,1,,,"Accepted: FW: Global Fun Time (Feb. 11, 2011)",s.s@abc.com,aa.aa@abc.com,2019-02-20T21:03:47.931Z;SRV=abc.com:TOTAL-FE=0.000|SMR=0.004;SRV=ABC001.com.com:TOTAL-HUB=0.383|SMR=0.157(SMRDE=0.005|SMRC=0.151(SMRCL=0.111|X-SMRCR=0.156))|CAT=0.205(CATOS=0.034 (CATSM=0.033(CATSM-Unified Group Post Sent Item Routing Agent=0.004|CATSM-Malware Agent=0.027 ))|CATRESL=0.005|CATORES=0.163(CATRS=0.163(CATRS-ScanMail Routing Agent=0.148|CATRS-Index Routing Agent=0.013 )))|QDI=0.024;SRV=ABC001.COM.COM:TOTAL-HUB=0.441|SMR=0.165(SMRDI=0.012|SMRC=0.153(SMRCL=0.099|X-SMRCR=0.156))|CAT=0.126(CATOS=0.001 (CATSM=0.001)|CATRESL=0.001|CATORES=0.121(CATRS=0.121(CATRS-ScanMail Routing Agent=0.120

Any help would be helpful

0 Karma

woodcock
Esteemed Legend

Use this:

[OriginalSourcetypeHere]
SEDCMD-mask = s/\,{3}(\"[^\"]+\"|\w+\S[^,]*|\"\W.+\"|\S[^,]*)\,\s*\d+\)/\,{3}(###)\,/g

If you are overriding/overwriting the sourcetype, USE THE ORIGINAL VALUE.
Deploy to the first full instance of Splunk that gets the events (in your case HF tier).
Restart all Splunk instances there.
Send in new data.
When validating, use All time for your Timepicker and add index_earliest=-5m to your search SPL.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...