Skip to main content
Loading

ES|QL VARIANCE_OVER_TIME function

Calculates the population variance over time of a numeric field.

field
the metric field to calculate the value for
window

the time window over which to compute the variance over time

Calculates the population variance over time of a numeric field.

field window result
double time_duration double
integer time_duration double
long time_duration double
TS k8s
| STATS avg_var_cost=AVG(VARIANCE_OVER_TIME(network.cost)) BY cluster, time_bucket = TBUCKET(1minute)
		
cluster:keyword time_bucket:datetime avg_var_cost:double
staging 2024-05-10T00:03:00.000Z 20.478516
qa 2024-05-10T00:21:00.000Z 16.0
qa 2024-05-10T00:18:00.000Z 11.192274
staging 2024-05-10T00:09:00.000Z 10.446904