Splunk Search

How to make a dashboard of the last three month of avg cpu load?

chandankr
Path Finder

i want to make a dashboard of last 3 month of avg cpu load and max cpu load

For example:
dec= 320
dec=10
dec=40
dec=90
nov= 347
nov=150
nov=60
oct= 300
oct=320
and so on

for dec
320+10+40+90/31
same for nov and oct


So for that , need to calculate last 3 months count and last month count in same query.
Please suggest.

Labels (1)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @chandankr,

let me understand do you want the montly or the daily avg?

then do you have a field called month or do you have a field for each month (es. dec, nov, oct)?

if the monthly and you have a field called month you should try something like this:

index=your_index
| stats avg(month) AS monthly_avg BY month

if you have a field name for each month (and it isn't an efficient solution) you have to use something like this:

index=your_index
| stats avg(eval(dec>0 OR nov>0 OR oct>0)) AS last_quarter_avg

if you want a daily average, you have to fix the month lenght

index=your_index
| stats sum(eval(dec>0)) AS dec sum(eval(nov>0)) AS nov sum(eval(oct>0)) AS oct
| eval avg_dec=dex/31, avg_nov=nov/30, avg_oct=oct/31
| table avg*

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!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...