Getting Data In

How can SEDCMD be used to extract and modify KV pairs from multiline events?

crisjnelson
Explorer

Here is a sample event I am attempting to parse and substitute 'SomeData=.*Transaction Type : ' with 'TxnType='

DT=2018-01-23T14:29:56.456-0800 | AppId=R4 |AppInst=SIMULATOR:201801231429 |LogId=TxLog |TxCode=Zoom | Level=INFO |SomeData=[UID:xxxxxxxxxxxx:SIMULATOR:2018012314, Message Timestamp:2018-01-23 14:29:55.976] [Zoom Result Code : ]
[Fun : 00]
[Transaction Identifier : 987xxxxxxxxxxxxx]
[Transaction Type : 00]
[More Fun : 00]

I have made various attempts. Here is my latest...

SEDCMD-all = s/SomeData=[.\r\n]+Transaction\sType\s:\s/TxnType=/g

0 Karma

harsmarvania57
Ultra Champion

Hi,

Can you please try this?

SEDCMD-all = s/(?s)SomeData=.*\[Transaction\sType\s\:/TxnType=/g
0 Karma

crisjnelson
Explorer

Excellent! Much appreciated.... I had tried the flags prior, but another portion of the expression must not have been correct. Thanks!

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...