Splunk Search

extract all "cause by"

indeed_2000
Motivator

Hi

I have lots "Caused by:" in (single or  multiple) events

How extract all line that contain "Caused by:"

like this:

Caused by: java.sql.SQLException: ISAM error: duplicate value for a record with unique key.

Any idea?

Thanks,

Labels (5)
0 Karma
1 Solution

nmohammed
Builder

Can you share the exception with multiple Caused by : ?

meanwhile, you can try this - 

base search
| rex field=_raw "Caused by:\s*(?P<exception_cause>.*)"

View solution in original post

nmohammed
Builder

Can you share the exception with multiple Caused by : ?

meanwhile, you can try this - 

base search
| rex field=_raw "Caused by:\s*(?P<exception_cause>.*)"

PickleRick
SplunkTrust
SplunkTrust

Ahhh... the infamous java logs and stacktraces.

For java I believe the only reasonable solution is to force the source end to produce the logs in civilized format (i.e. properly configure log4j). Otherwise you end up with something unparseable, especially if you manage to get timstamp at the beginning of each log line - it's game over. There's nothing reasonable to correlate the logs on.

0 Karma

indeed_2000
Motivator

any other idea?

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

If you have the log in which every entry begins with the timestamp and you luckily don't have the timestamp repeated, you might try breaking the events at timestamp. That way you'll get your huge event.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...