Docs

v2.0

shift() function

The shift() function adds a fixed duration to time columns. The output table schema is the same as the input table. If the time is null, the time will continue to be null.

Function type: Transformation
Output data type: Object

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

Parameters

shift

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

Data type: Duration

columns

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

Data type: Array of strings

Examples

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)

Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community