Documentation

set() function

Flux 0.7.0+

The set() function assigns a static value to each record in the input table. The key may modify an existing column or add a new column to the tables. If the modified column is part of the group key, the output tables are regrouped as needed.

set(key: "myKey",value: "myValue")

Parameters

key

(Required) The label of the column to modify or set.

value

(Required) The string value to set.

tables

Input data. Default is piped-forward data (<-).

Examples

The following example uses data provided by the sampledata package to show how set() transforms data.

import "sampledata"

sampledata.int()
  |> set(key: "host", value: "prod1")

View input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.