Splunk Search

Why am I getting this error when using regex for URI search?

ghildiya
Explorer

I have the following query to search results which contain a specific rest endpoint which has a UUID path parameter:

 

 

.... | regex requestURI="/baseurl/\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b

 

 

But it seems to be wrong. Error is :

 

 

Unknown search command '0'.

 

 

What is the mistake I am making here?

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
Splunk appears to be interpreting part of your regular expression as a subsearch. Make sure the expression is enclosed in quotation marks and any embedded quotation marks are escaped.
---
If this reply helps you, Karma would be appreciated.
0 Karma

ghildiya
Explorer

I tried this:

.... | regex requestURI=*/baseurl/\"[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\"*

But this too doesn't work. 

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
The regex command is still missing the enclosing quotation marks.
---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...