Splunk Search

How to search for the exact URI with wildcards within the URI field?

Splunk_SachinKu
New Member

Hi All,

I have following URI in my logs.

/svc/appName/1234567890/catalog/search/(status),
/svc/appName/1234567890/catalog/search/(info)
/svc/appName/1234567890/catalog/search/(update),
/svc/appName/1234567890/catalog/search/

where 1234567890 is user id. I would like to search for /svc/appName//catalog/search/.

I am using following to search
index=jboss sourcetype=jboss_tomcat_access_log /catalog/search/.

But it returns all of the above URIs.

How would I search for the exact URI for all the user ids?

Thank You!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You're searching for text that appears in all events so you will get all events in your results. To narrow the results, add qualifiers to your search. Is the URI in a field? If so, you can try

index=jboss sourcetype=jboss_tomcat_access_log /catalog/search/ | where like(URI,"%/catalog/search/" | ...

Otherwise, try

index=jboss sourcetype=jboss_tomcat_access_log /catalog/search/ NOT "/catalog/search/(*"

to exclude events that have parens near the end.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...