Dashboards & Visualizations

Finding Average based on last 5 days transaction?

ubp1252
Explorer

Hi,

We have data which will display total tarnsactions and success transactions count based on our time range.But we got one requirement that when some incident happen that time the count we are getting very less compared to other days.So our target is whenever we got that type less transactions we need to average for last 3 days total transactions and display that number instead of less transaction count.Please help how to solve this.

Sample Data:

DateTotal_tranasactionsSuccess_tranasactions
01-04-2021   8070
02-04-2021   7570
03-04-2021   10090
04-04-2021   102

 

Expected Output:

DateTotal_tranasactionsSuccess_tranasactions
01-04-2021   8070
02-04-2021   7570
03-04-2021   10090
04-04-2021  avg of last 3 days2
Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| streamstats window=3 sum(Total_tranasactions) as rolling3total count as days by Date
| eval average3days=rolling3total / days
| eval Total_tranasactions=if(Total_tranasactions < 20, average3days, Total_tranasactions)
0 Karma
Get Updates on the Splunk Community!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

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

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...