Splunk Search

Trying to extract field in log file, can you please help with regex and field extraction.

PavanSeerapu
Explorer

Caused by: java.sql.SQLException: Io exception: Socket closed

i want to extract "java.sql.SQLException"

 

Can you please do the needful.

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @PavanSeerapu,

You can use below rex command;

 

| rex "[^:]+:\s+(?<exception>[^:]+)"

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @PavanSeerapu,

This regex does not work, because there is a problem with double-quotes and there is no numeric value. Please try below;

| rex "java.sql.SQLException:\s+(?<SQLexception>.*)"
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

PavanSeerapu
Explorer

| rex field=_raw "Caused by"\:\s+(?P<SQLexception>\d+)

 

I tried this but didn't work

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @PavanSeerapu,

You can use below rex command;

 

| rex "[^:]+:\s+(?<exception>[^:]+)"

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...