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!

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...