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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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