Splunk Search

Search Query Help!

kc_prane
Path Finder

Hello, I am looking for my search results for only 6pm to 9pm over the last 90 days. How can I achieve this with the below query?

index=* host=*  | eval pctCPU=if(CPU="all",100-pctIdle,Value) | timechart  avg(pctCPU) AS avgCPU BY host
Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try filtering the results on the date_hour field.

index=* host=*  
| where date_hour>=18 AND date_hour<21
| eval pctCPU=if(CPU="all",100-pctIdle,Value) 
| timechart  avg(pctCPU) AS avgCPU BY host
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...