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
Get Updates on the Splunk Community!

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 ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...