Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

How do I write a search to calculate a moving average using the current value, previous 2 values, and the next value?

$
0
0
Need your help, Please refer the below data structure. We want to calculate the and display moving average of the current value, previous 2 values, and the next value. Input: Month, Value 201501,100 201502,50 201503,50 201504,100 201505,50 201506,100 Output: Month, Value,Moving_Average 201501,100, 201502,50, 201503,50,75 201504,100,62.5 201505,50,75 201506,100, So the moving average per row would be calculated using the current row's value, previous 2 values, and the next value, displaying the average in the current row. (100+50+50+100=300/4=75). Can you please help form the Splunk search for this structure?

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>