Calculates percentiles over numbers. It works on non-negative input values.
Returns one event with a field for each of the percentiles specified in the percentiles parameter. Fields are named like by appending _ to the values specified in the percentiles parameter. For example the event could contain the fields _50, _75 and _99.
Function Traits: Aggregate
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
accuracy | number | optional | 0.001 | Relative accuracy as a decimal. |
Minimum | 0 | |||
Maximum | 1 | |||
as | string | optional | Prefix of output fields. | |
field [a] | string | required | Specifies the field for which to calculate percentiles. The field must contain numbers. | |
percentiles | Array of numbers | optional | [50, 75, 99] | Specifies which percentiles to calculate. |
The parameter name for field
can be omitted; the following forms are equivalent:
logscale
percentile("value")
and:
logscale
percentile(field="value")
percentile()
Examples
Calculate 50 75 99 and 99.9 percentiles for events with the field responsetime.
logscale
percentile(field=responsetime, percentiles=[50, 75, 99, 99.9])
In a timechart, calculate percentiles for both of the fields r1 and r2.
logscale
timechart(function=[percentile(field=r1,as=r1),percentile(field=r2,as=r2)])