avg()

avg(col) returns the average (mean) of the values in the provided column.

Non-numeric values are ignored. If the provided column does not have any numeric values or the column does not exist, avg will return null.

Returns

A table with one row and one column, called @q.avg.

Example

Compute the averaged elapsed time in milliseconds for requests in the checkout_api service, aggregated by host.

kubernetes.container_name: "checkout_api"
| stats avg(log.%kv.elapsed_ms) by host

Last updated