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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...