Skip to main content

Aggregations

Aggregation functions of stats, eventstats, streamstats, timechart and chart. merge tells how partial results of an aggregation combine.

FunctionSupportMergeNotes
avgfullexactArithmetic mean of the numeric values.
cfullexactalias of count
countfullexactcount() and count(*) count rows; count(x) counts non-NULL x; count(eval(cond)) counts rows where cond is TRUE
dcfullexactalias of distinct_count, which counts differently in the columnar executor and the row operators
distinct_countfullexactnumber of distinct non-NULL values; the columnar executor counts exactly and tells kinds apart (1, 1.0 and '1' are three values); the row operators compare values by their text (1, 1.0 and '1' are one value) and, in stats, estimate with HyperLogLog beyond 10,000 values per group
distinct_count_approxfullapproximatethe columnar executor counts exactly up to 383 values per group and estimates beyond with a 1.6% standard error; the row operators count it as distinct_count
earliestfullexactthe value of the row with the earliest _time; a time field other than _time or @timestamp is not supported
firstfullnoneThe first non-NULL value in input order.
lastfullnoneThe last non-NULL value in input order.
latestfullexactthe value of the row with the latest _time; a time field other than _time or @timestamp is not supported
listfullnoneArray of the non-NULL values in input order, at most 100.
maxfullexactLargest value; numbers order before strings.
medianfullapproximatepercentile(x, 50)
minfullexactSmallest value; numbers order before strings.
per_dayfulltimechart only: sum(x) per day of the span
per_hourfulltimechart only: sum(x) per hour of the span
per_minutefulltimechart only: sum(x) per minute of the span
per_secondfulltimechart only: sum(x) per second of the span
percentilefullapproximatet-digest; the optional compression argument is accepted and not used
percentile_approxfullapproximatealias of percentile
stddev_popfullexactPopulation standard deviation of the numeric values.
stddev_sampfullexactSample standard deviation of the numeric values; NULL for fewer than two.
sumfullexactSum of the numeric values.
takefullnonedefault size 10
valuesfullexactSorted array of the distinct non-NULL values, at most 100.
var_popfullexactPopulation variance of the numeric values.
var_sampfullexactSample variance of the numeric values; NULL for fewer than two.