Splunk Search

saved searches

Siddharthnegi
Contributor

can I find all the saved searches which are using index=* rather than giving specific name. And all the saved searches which are not using (index) in their search

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Something like

| rest /services/saved/searches
| where match(search, "\bindex *= *(\* |\*$)")
  OR NOT match(search, "\bindex *=")
| fields title search
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

This will get you the saved searches

| rest "/servicesNS/-/-/saved/searches" splunk_server=local 

and it will return a field called 'search' - you can then look in that to see what search statements are being used. Note that if your search contains macros you will also have to expand the macros too and search those.

 

0 Karma
Get Updates on the Splunk Community!

The OpenTelemetry Certified Associate (OTCA) Exam

What’s this OTCA exam? The Linux Foundation offers the OpenTelemetry Certified Associate (OTCA) credential to ...

From Manual to Agentic: Level Up Your SOC at Cisco Live

Welcome to the Era of the Agentic SOC   Are you tired of being a manual alert responder? The security ...

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 4)

Welcome back to Splunk Classroom Chronicles, our ongoing series where we shine a light on what really happens ...