group() function

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)

This documentation is open source. See a typo? Please, open an issue.


Need help getting up and running? Get Support