Splunk Search

how to extract from java.lang

GreeshmaV
New Member

My events look like this
TYP=ERR, TS1=1423574799157, TS2=1423574799157, CMP=PUR, EDESC=Unknown Host
java.lang.Exception: Validation failed: input param is NULL
LogClient.java:39)

How to extract from java.lang.Exception to the end of the event using regular expression

Tags (2)
0 Karma

thomrs
Communicator

Off the top of my head something like this

(?i)java.lang.Exception:\s?<field>(.+)$
0 Karma

cpetterborg
SplunkTrust
SplunkTrust

This works for my data (YMMV) at search time:

"java.lang.Exception" | rex field=_raw "(?ms)java.lang.Exception(?P<exception>.+)"
0 Karma

thomrs
Communicator

add (?ms) on the beginning - the s is dotall, and the m is multi-line.

 (?ms)java.lang.Exception:\s?<field>(.+)
0 Karma

GreeshmaV
New Member

its multiline event

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Is that the entire event? I ask because of the mis-matched paren. Is it a single-line or multi-line event?

---
If this reply helps you, Karma would be appreciated.
0 Karma
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 ...