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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...