sum() function

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

The sum() function computes the sum of non-null records in specified columns.

Function type: Aggregate
Output data type: Integer, UInteger, or Float (inherited from column type)

sum(columns: ["_value"])

Parameters

columns

Specifies a list of columns on which to operate. Defaults to ["_value"].

Data type: Array of strings

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> filter(fn: (r) =>
    r._measurement == "cpu" AND
    r._field == "usage_system"
  )
  |> sum()

SUM()