Splunk Search

Why shouldn't we search index=*

sogeniusio
Path Finder

I'm interested in knowing why it's frowned upon not to search index=*. I was asked by one of our employees and remembered it being mentioned at this .conf.

0 Karma
1 Solution

elliotproebstel
Champion

The more restricted you can make your base search, the more efficient that search will be. So if you know your data is in index=windows_logs but instead search index=*, you are forcing Splunk to examine a very large number of buckets that won't contain your data. Narrowing your time window and your searched indexes are a really great place to start in crafting an efficient base search.

More details (and lots more tips!) can be found here:
http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Search/Writebettersearches

View solution in original post

0 Karma

woodcock
Esteemed Legend

Which would be a more efficient search for your car keys?

"somewhere in Texas"
OR
"somewhere in Dallas"
OR
"somewhere in my house"

The more details that you give, the fewer places (buckets of compressed data) need to be searched. If you know that
index="Dallas" AND sourcetype="my house", then say so!

That being said, as long as you are fully qualifying indexed fields (e.g. host="MyHost"), it is MUCH less of a big deal. Also, if this is ad-hoc stuff, it is not too bad. It can really add up, though, if you save and schedule open-ended searches like this. A running search fully consumes a core on each indexer and the search head.

elliotproebstel
Champion

The more restricted you can make your base search, the more efficient that search will be. So if you know your data is in index=windows_logs but instead search index=*, you are forcing Splunk to examine a very large number of buckets that won't contain your data. Narrowing your time window and your searched indexes are a really great place to start in crafting an efficient base search.

More details (and lots more tips!) can be found here:
http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Search/Writebettersearches

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...