Getting Data In

Parsing comma separated values

danurag
Explorer

I have a script that outputs data in the following format. The problem is that the value of the Error field gets initialized to "No" and ignores the Error part. Also, the Error field could have have a completed stack trace and flow into multiple lines. How do I write the transforms stanza so that it assigns all the values to the "Error" field.

ElapsedTime=2.2812208, StatusCode=OK, ContentMatched=False, Error=No Error

Thank you

Tags (1)
0 Karma

yannK
Splunk Employee
Splunk Employee

try the inline regex,

mysearch | rex field=hop "Error=(?<Error>([^=]*)$)" | table Error

then once confirmed working, you can define an automatic field extraction
see http://docs.splunk.com/Documentation/Splunk/4.2.5/Knowledge/Managesearch-timefieldextractions

danurag
Explorer

Hi MuS, I need help with writing the complete regex. Could you please give me some pointers.

Thanks.

0 Karma

MuS
Legend

Hi danurag

you can use a regex like this ([^=]*)$ to match everything after the last = to be extracted

cheers

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...