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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...