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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...