Splunk Search

How to improve efficiency of a Splunk search?

nilbak88
Explorer

Hi All,

One of my scheduled report is quite expensive.
It runs everyday from Monday to Friday and results in 30 days worth of data.

Search Query
index=abc_* | stats count by index,host

How can I improve its search efficiency?
Please suggest .

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could put your daily counts into a summary index, then create a report which sums counts from the summary index for the last 30 days

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @nilbak88,

if in your search you have to use only index and host, you can use | metasearch for faster searches:

| metasearch index=abc_* 
| stats count by index host

for more infos see at https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Metasearch

Ciao.

Giuseppe

0 Karma

nilbak88
Explorer

Thanks @gcusello 

That was really quick and helpful.
Also, is there is any possibility if we can modify time range setting in such a way that is do not overlap the data.

Like currently, its running everyday and resulting 30 days of data since time range is set as of 30 days.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @nilbak88 ,

if you want to fix the time range e.g. from the last 30 days to the end of yestarday, you could add some time modifiers like this:

| metasearch index=abc_* earliest=-30d@d latest=@d
| stats count by index host

Ciao.

Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...