ES|QL AVG_OVER_TIME function
field- the metric field to calculate the value for
window-
the time window over which to compute the average
Calculates the average over time of a numeric field.
| field | window | result |
|---|---|---|
| aggregate_metric_double | time_duration
|
double |
| double | time_duration
|
double |
| exponential_histogram
|
time_duration
|
double |
| integer | time_duration
|
double |
| long | time_duration
|
double |
| tdigest
|
time_duration
|
double |
TS k8s
| STATS max_cost=MAX(AVG_OVER_TIME(network.cost)) BY cluster, time_bucket = TBUCKET(1minute)
| max_cost:double | cluster:keyword | time_bucket:datetime |
|---|---|---|
| 12.375 | prod | 2024-05-10T00:17:00.000Z |
| 12.375 | qa | 2024-05-10T00:01:00.000Z |
| 12.25 | prod | 2024-05-10T00:19:00.000Z |
| 12.0625 | qa | 2024-05-10T00:06:00.000Z |