group() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.65 is the most recent stable version of Flux.

The group() function groups records based on their values for specific columns. It produces tables with new group keys based on provided properties.

Function type: Transformation
Output data type: Object

group(by: ["host", "_measurement"])

// OR

group(except: ["_time"])

// OR

group(none: true)



List of columns by which to group. Cannot be used with except.

Data type: Array of strings


List of columns by which to not group. All other columns are used to group records. Cannot be used with by.

Data type: Array of strings


Remove existing groups as well as partitions created by the window() function.

Data type: Boolean


Group by host and measurement
from(bucket: "telegraf/autogen")
  |> range(start: -30m)
  |> group(by: ["host", "_measurement"])
Group by everything except time
from(bucket: "telegraf/autogen")
  |> range(start: -30m)
  |> group(except: ["_time"])

GROUP BY (similar but different)