Dashboards & Visualizations

Get a list of all views and or searches that use an index

rmorlen
Splunk Employee
Splunk Employee

I would like to get a list of all views and/or searches that use a specific index. Can I do this using a splunk search?

Tags (1)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

In principle you could use the rest (core Splunk) or splunkentity (SideviewUtils) commands to load saved searches, and perform calculations based on their search string - for example, looking for index=specific.

However, I don't think that's an easy-to-answer question, even for a human looking at the searches.
Take a search that doesn't specify an index as an example, that will search whatever indexes are set as default for the user's role so whether it does search your specific index or not depends on the user executing the search.
Answering that question becomes really messy once you compute an index from a subsearch result...

martin_mueller
SplunkTrust
SplunkTrust

If you only want to consider searches that explicitly list index=specific then you should easily be able to deduce that from the above two ways of loading saved searches.

0 Karma

rmorlen
Splunk Employee
Splunk Employee

I'm interested in the searches that "do" specify the index. For our users one of the best practice tips we give them is that they specify the index. We found that it greatly improves search time.

We have over 100 indexes so if you don't specify the index then splunk has to open every index on every indexer to see if there are matching events. This can take a while.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...