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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...