# MAX_OVER_TIME

Calculates the maximum value of a field within a specified time window.

## Syntax

`MAX_OVER_TIME(field, window)`

### Parameters

#### field

The metric field to calculate the maximum value for.

#### window

The time window over which to compute the maximum.

## Examples

Calculates the maximum network cost per cluster, grouped into 1-minute time buckets.

```esql
TS k8s
| STATS cost=SUM(MAX_OVER_TIME(network.cost)) BY cluster, time_bucket = TBUCKET(1minute)
```
