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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...