Used to compute multiple aggregate functions over the input.

logscale
...
| stats(function=[min(), max()])

Is equivalent to:

logscale
[min(),max()]

It produces one row of data that contains both min and max results.

ParameterTypeRequiredDefaultDescription
function[a]Array of Aggregate Functionsoptional[b]count(as=_count) Specifies which aggregate functions to perform on each group.

[a] The argument name function can be omitted.

[b] Optional parameters use their default value unless explicitly set

Omitted Argument Names

The argument name for function can be omitted; the following forms of this function are equivalent:

logscale
stats("count(as=_count)")

and:

logscale
stats(function="count(as=_count)")

These examples show basic structure only; full examples are provided below.

stats() Examples

This is equivalent to just count():

logscale
stats(function=count())

Find the maximum and minimum:

logscale
[min_response := min(responsetime), max_response := max(responsetime)]