# Aggregation Operators

Aggregation operators help aggregate log messages into groups. FuseQL supports the following aggregation operators:

- [count](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#count) all log lines or fingerprints

- [count_unique](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#count-unique) of labels or string-valued facets

- statistical operations — [min](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#min), [max](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#max), [avg](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#avg), [sum](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#sum), [stddev](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#stddev), [stdvar](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#stdvar) and [percentiles](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#percentiles) — on numeric or duration facet values

- ordered aggregation operations — [first](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#first) and [last](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#last)

Facet values have duration datatype if they follow the go language duration format. When applying aggregation operators to these values, FuseQL normalizes them to a nanosecond float value.

FuseQL applies aggregations **_after_** applying the filters specified in the log search bar, and in the time range selected in the time picker. All aggregations are grouped by time buckets, unless user specifies additional grouping from the  dropdown.

Kloudfuse automatically selects the [count](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#count) and [count_unique](https://docs.kloudfuse.com/platform/3.2.5/fuseql-aggregation-operators/#count-unique) operators by default, depending on the data type of the variable. For other operators, click the drop-down next to the  label, and select the aggregation operator.

## avg

Computes the average value of numeric or duration-valued facets.

## count

Counts the total number of log lines.

## count_unique

Counts only unique or distinct occurrences of the field. This operator can be applied on fingerprints, labels or string valued facets (facet value can be of string/UUID/IP address datatype).

## first

Computes the first value of numeric or duration valued facets.

## last

Computes the last value of numeric or duration valued facets.

## max

Computes the max value of numeric or duration valued facets.

## min

Computes the min value of numeric or duration valued facets.

## percentiles

Computes the percentiles (p50, p75, p90, p95 or p99) of numeric or duration valued facets.

## stddev

Computes the standard deviation of numeric or duration valued facets.

## stdvar

Computes the standard variance of numeric or duration valued facets.

## sum

Computes the sum of numeric or duration valued facets.
