Flux is InfluxData’s new functional data scripting language designed for querying, analyzing, and acting on time series data. Its takes the power of InfluxQL and the functionality of TICKscript and combines them into a single, unified syntax.
Flux v0.7 is a technical preview included with InfluxDB v1.7. It is still in active development and many functions provided by InfluxQL and TICKscript have yet to be implemented.
Flux design principles
The following example illustrates pulling data from a bucket (similar to an InfluxQL database) for the last five minutes,
filtering that data by the
cpu measurement and the
cpu=cpu-usage tag, windowing the data in 1 minute intervals,
and calculating the average of each window:
from(bucket:"telegraf/autogen") |> range(start:-1h) |> filter(fn:(r) => r._measurement == "cpu" AND r.cpu == "cpu-total" ) |> aggregateWindow(every: 1m, fn: mean)
Flux is packaged with InfluxDB v1.7+ and does not require any additional installation, however it does need to be enabled.
The best way to familiarize yourself with Flux is to walk through creating a simple Flux query. The getting started documentation does just that.