Splunk Search

Improving Search Speed in Stats Query

TylerJVitale
Explorer

I'd like to run search to look at average and max values for every server over an extended period of time. Currently I'm doing

index=os sourcetype="sourcetype" source="source"|stats avg(Value) max(Value) by host

But this is taking an extremely long time to run. Is there a way to make this search more efficient?

Tags (1)
0 Karma

skoelpin
SplunkTrust
SplunkTrust

Are you running a separate search for each process? If so, you could build a simple if statement to specify the value like this

index=os
| eval CPU=if(counter="% Processor Time",'Value',"N/A")
| eval Disk=if(counter="% Free Space",'Value',"N/A")

If not then you may want to look into accelerated data models. This will run substantially faster than over the raw data

http://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/Acceleratedatamodels

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...