Dashboards & Visualizations

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

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

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...

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

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
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!