Splunk Search

|rex field=_raw (?<Severity?\s\w{7,8}\;) not working

vijaya5
Engager

Hi All,

 

I am trying to use below regex in my splunk SPL, which is working fin in rubular but not working as SPL.

 

|rex field=_raw (?<Severity?\s\w{7,8}\;) not working

 

 

Please suggest

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Shouldn't the expression include ">" after Severity?

(?<Severity>\s\w{7,8}\;)

Although this would include the space, followed by 7 or 8 letters/numbers and a semi-colon in the extracted field. Perhaps this might work better

"\s(?<Severity>\w{7,8})\;"

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Shouldn't the expression include ">" after Severity?

(?<Severity>\s\w{7,8}\;)

Although this would include the space, followed by 7 or 8 letters/numbers and a semi-colon in the extracted field. Perhaps this might work better

"\s(?<Severity>\w{7,8})\;"

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @vijaya5,

without a sample of your logs it's realy difficoult to try to help you!

Anyway, probably the problem is that quotes on the border of the regex are missing in the rex command.

Please, use Code sample for your regex.

Ciao.

Giuseppe

0 Karma

vijaya5
Engager
 
Tags (1)
0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...