All Apps and Add-ons

calculate avg in specific period

hqw
Path Finder

Hi all,

I want to calculate average performance of my server in last month, since for different servers, they were reporting different days in a period, and if i use average for total (with 30 days), it may draw down some performance of a server, so now i just use total performance for each server divide the total reporting date for that server. but somehow my search is not working, i can't get anything out. could you pls kindly guild me what is wrong?

Best Regards

my search:

interaction_count earliest=-30d latest=@d | eval date = strftime(_time, "%Y-%m-%d") |stats dc(date) AS "Reporting_date" by mount_name | stats sum(interaction_count) as sum_day_interaction_count by mount_name |eval avg=sum_day_interaction_count/Reporting_date |table mount_name, avg

0 Karma
1 Solution

HiroshiSatoh
Champion

What with this?

interaction_count earliest=-30d latest=@d | eval date = strftime(_time, "%Y-%m-%d") |stats dc(date) AS "Reporting_date", sum(interaction_count) as sum_day_interaction_count by mount_name|eval avg=sum_day_interaction_count/Reporting_date |table mount_name, avg

View solution in original post

0 Karma

HiroshiSatoh
Champion

What with this?

interaction_count earliest=-30d latest=@d | eval date = strftime(_time, "%Y-%m-%d") |stats dc(date) AS "Reporting_date", sum(interaction_count) as sum_day_interaction_count by mount_name|eval avg=sum_day_interaction_count/Reporting_date |table mount_name, avg

0 Karma

hqw
Path Finder

Hi Hrio,

I had fixed this problem with a join inside. Thanks for your help on this.

Best regards

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...