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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...