Splunk Search

Splunk group by value with pattern matching

msrama5
Explorer

I have saved search below FirstQuery which group by values with pattern matching and want to classify anything not falling under regx pattern for APIFamily in "URI "(?APIFamily[/\w.]+/v\d+)/" " to classify as other category in search query 2, Any ideas how to get the values not matching group by in other category ?

FirstQuery -
search environment=test
index=iis* NOT "GET / - 80" NOT "GET / - 443" NOT "/ping*" NOT "swagger"
|eval URI=lower(cs_uri_stem)
|rex field=URI "(?APIFamily[/\w.]+/v\d+)/"

Search Query 2 on FirstQuery
| savedsearch FirstQuery
| search *
| stats count as total, count(eval(sc_status>304)) as errors, count(eval(sc_status<304)) as pass by APIFamily

Tags (1)
0 Karma

jpolvino
Builder

Can you please repost, and use the tick marks (key above the tab key on US keyboards) around code? This will help readability and prevent the board from stripping content.

0 Karma
Get Updates on the Splunk Community!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...