Query data with Flux
The following guides walk through both common and complex queries and use cases for Flux.
Example data variable
Many of the examples provided in the following guides use a
which represents a basic query that filters data by measurement and field.
data is defined as:
data = from(bucket: "example-bucket")
|> range(start: -1h)
|> filter(fn: (r) =>
r._measurement == "example-measurement" and
r._field == "example-field"
Flux query guides
filter() function to query data based on fields, tags, or any other column value.
filter() performs operations similar to the
SELECT statement and the
WHERE clause in InfluxQL and other SQL-like query languages.
This guide walks through grouping data with Flux by providing examples and illustrating how data is shaped throughout the process.
This guide walks through sorting and limiting data with Flux and outlines how it shapes your data in the process.
This guide walks through windowing and aggregating data with Flux and outlines how it shapes your data in the process.
This guide describes how to use Flux to transform data with mathematic operations.
This guide walks through using the
histogram() function to create cumulative histograms with Flux.
median() function to return a value representing the
0.5 quantile (50th percentile) or median of input data.
quantile() function to return all values within the
q quantile or percentile of input data.
cumulativeSum() function to calculate a running total of values.
Use the Flux
exists operator to check if an object contains a key or if that key’s value is
Create your own custom Flux functions to transform and manipulate data.
Use Flux stream and table functions to extract scalar values from Flux query output. This lets you, for example, dynamically set variables using query results.
This guide walks through joining data with Flux and outlines how it shapes your data in the process.
Use Flux to process and manipulate timestamps.
Flux provides several functions to help monitor states and state changes in your data.
sql package provides functions for working with SQL data sources. Use
sql.from() to query SQL databases like PostgreSQL and MySQL
This guide describes how to use Flux conditional expressions, such as
then, to query and transform data.
This guide walks through using regular expressions in evaluation logic in Flux functions.
Use the Flux Geo package to filter geo-temporal data and group by geographic location or track.
Bug Reports and Feedback
Thank you for being willing to help test InfluxDB v2.0 beta!
Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.
Submit feedback using one of the following methods: