Removed: 1.21
This query function has been removed.
EXPERIMENTAL. Calculates percentiles over numbers. Returns one event with a field for each of the percentiles specified in the percentiles parameter. Fields are named like by appending _ (underscore) to the values specified in the percentiles parameter. For example the event could contain the fields _50, _75 and _99. Input can be a number OR the special format for the moment sketch "[min,max,Σv⁰,Σv¹,Σ,²,...]" used for client-side computed sketches.
Parameter | Type | Required | Default Value | Description |
---|---|---|---|---|
as | string | optional[a] | Prefix of output fields. | |
field [b] | string | required | Specifies the field for which to calculate percentiles. The field must contain numbers. | |
k | number | optional[a] | 5 | Specifies the order of the underlying polynomial. |
percentiles | number | optional[a] | [50, 75, 99] | Specifies which percentiles to calculate. |
[a] Optional parameters use their default value unless explicitly set. |
Hide omitted argument names for this function
Omitted Argument NamesThe argument name for
field
can be omitted; the following forms of this function are equivalent:logscale Syntaxmoment("value")
and:
logscale Syntaxmoment(field="value")
These examples show basic structure only.
moment()
Examples
Calculate 50,75,99, and 99.9 percentiles for events with the field responsetime:
percentile(field=responsetime, percentiles=[50, 75, 99, 99.9])
In a timechart, calculate percentiles for both of the fields r1 and r2:
timechart(function=[percentile(field=r1,as=r1),percentile(field=r2,as=r2)])