group() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.50 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)

Parameters

by

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

Data type: Array of strings

except

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

none

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

Data type: Boolean

Examples

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)