Splunk Search

rex for extracting particular keyword in logs

prajwal_94
Explorer

I am searching for exceptions/the type of exception in logs and using below query-

index=abcd ("*Exception" OR "*exception") | rex "(?P<Exception>.*\..*Exception:)" | eval mvFields=split(Exception, " ") | eval Exception1=mvindex(mvFields,mvfind(mvFields,"\..*Exception")) | timechart span=5m count by Exception1

but when I expand the time range to 4-7 days, I get the below alert message(although I get the output) 

Error in rex command: regex= "(?P<Exception>.*\..*Exception:)" has exceeded configured match_limit, consider raising the value in limits.conf

looking for more efficient way in which the above search can be refined without making any changes to limits.conf

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

The initial search for "exception" is case insensitive and doesn't need the leading wildcard

It looks like you are trying to capture the exception delimited by spaces with at least one dot.

index=abcd exception 
| rex "\s(?P<Exception>[^\s]*\.[^\s\.]*Exception:)" 
| timechart span=5m count by Exception

 

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

The initial search for "exception" is case insensitive and doesn't need the leading wildcard

It looks like you are trying to capture the exception delimited by spaces with at least one dot.

index=abcd exception 
| rex "\s(?P<Exception>[^\s]*\.[^\s\.]*Exception:)" 
| timechart span=5m count by Exception

 

Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...