Back to Elasticsearch

Clamp

docs/reference/query-languages/esql/_snippets/functions/examples/clamp.md

9.4.0528 B
Original Source

% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.

Example

esql
TS k8s
| EVAL full_clamped_cost = clamp(network.cost, clamp_max(network.bytes_in, 5), network.bytes_in / 100)
| KEEP full_clamped_cost, @timestamp
full_clamped_cost:double@timestamp:datetime
10.02024-05-10T00:18:33.000Z
9.02024-05-10T00:04:49.000Z
9.02024-05-10T00:15:51.000Z
9.02024-05-10T00:17:12.000Z
9.02024-05-10T00:20:46.000Z