All Apps and Add-ons

How does the moving average work?

rosho
Communicator

Hi

How does the "moving average work"?
With "trendline" I am computing 5 and 10 events. But with "streamstats" I am computing the statistics of only 5 events.

I do not understand.

This is the SPL from the MLTK.

| inputlookup cyclical_business_process.csv
| trendline sma5(logons) as sma5_logons ema10(logons) as ema10_logons
| eval this_date_day = strftime(_time, "%w")
| eval this_date_hour = strftime(_time, "%H")
| eval this_date_day = strftime(_time, "%w")
| eval this_date_day = this_date_day."_"
| eval this_date_hour = this_date_hour."_"
| reverse
| streamstats current=f window=5 first(logons) as LogonsFromTheFuture
| reverse
0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...