shift() 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 shift() function adds a fixed duration to time columns. The output table schema is the same as the input table.

Function type: Transformation
Output data type: Object

shift(shift: 10h, columns: ["_start", "_stop", "_time"])



The amount of time to add to each time value. The shift may be a negative duration.

Data type: Duration


The list of all columns to be shifted. Defaults to ["_start", "_stop", "_time"].

Data type: Array of strings


Shift forward in time
from(bucket: "telegraf/autogen")
	|> range(start: -5m)
	|> shift(shift: 12h)
Shift backward in time
from(bucket: "telegraf/autogen")
	|> range(start: -5m)
	|> shift(shift: -12h)