ES|QL CHANGES function

Calculates the number of value changes in a time window.

Embedded
field
the metric field to calculate the value for
window

the time window over which to compute changes

Calculates the number of times the value of a numeric or native histogram metric field changes in a time window.

field window result
counter_double time_duration long
counter_integer time_duration long
counter_long time_duration long
double time_duration long
exponential_histogram time_duration long
integer time_duration long
long time_duration long
TS k8s
| STATS cost_changes = SUM(CHANGES(network.cost)) BY time_bucket = TBUCKET(1 minute)
		
cost_changes:long time_bucket:datetime
1 2024-05-10T00:00:00.000Z
0 2024-05-10T00:01:00.000Z
2 2024-05-10T00:02:00.000Z