Splunk Search

How to repeat a regex to match more than one instances

att35
Builder

Hi,

We are using following regex to capture "caused by" exceptions within java stack trace.

Caused by: (?P<Exception>[^\r\n]+)

 

When testing in regex101, it seems to be working well. Captures both instances of "caused by" in the sample trace.

https://regex101.com/r/yL1ucO/1 

But when used with EXTRACT within props.conf, Splunk only gets the first instance, i.e. "SomeException". 2nd occurrence, "AnotherException" is not captured.

Should I be using REPEAT_MATCH with transforms stanza, or is there a way to fix this within props itself?

Labels (1)
Tags (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

Yes. The additional options are one of the reasons for using TRANSFORM-based exractions instead of REPORT.

Notice, however, that REPEAT_MATCH is for index-time extractions.  You might want to consider MV_ADD

View solution in original post

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Yes. The additional options are one of the reasons for using TRANSFORM-based exractions instead of REPORT.

Notice, however, that REPEAT_MATCH is for index-time extractions.  You might want to consider MV_ADD

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...