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!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...