2020-02-24 22:21:03 +00:00
|
|
|
---
|
2020-03-06 15:40:37 +00:00
|
|
|
title: Query data with Flux
|
|
|
|
description: Guides that walk through both common and complex queries and use cases for Flux.
|
|
|
|
weight: 102
|
2020-07-29 16:02:10 +00:00
|
|
|
influxdb/v2.0/tags: [flux, query]
|
2020-02-24 22:21:03 +00:00
|
|
|
menu:
|
2020-07-28 22:34:16 +00:00
|
|
|
influxdb_2_0:
|
2020-03-06 15:40:37 +00:00
|
|
|
name: Query with Flux
|
2020-02-24 22:21:03 +00:00
|
|
|
parent: Query data
|
2020-03-06 15:40:37 +00:00
|
|
|
alias:
|
|
|
|
- /v2.0/query-data/guides/
|
2020-07-28 21:59:56 +00:00
|
|
|
- /v2.0/query-data/flux/
|
2020-02-24 22:21:03 +00:00
|
|
|
---
|
2020-02-25 16:43:08 +00:00
|
|
|
|
2020-03-06 15:40:37 +00:00
|
|
|
The following guides walk through both common and complex queries and use cases for Flux.
|
2020-02-25 16:43:08 +00:00
|
|
|
|
2020-03-03 18:25:00 +00:00
|
|
|
{{% note %}}
|
|
|
|
#### Example data variable
|
|
|
|
Many of the examples provided in the following guides use a `data` variable,
|
2020-03-05 22:11:42 +00:00
|
|
|
which represents a basic query that filters data by measurement and field.
|
2020-03-03 18:25:00 +00:00
|
|
|
`data` is defined as:
|
2020-02-25 16:43:08 +00:00
|
|
|
|
|
|
|
```js
|
2020-03-03 18:25:00 +00:00
|
|
|
data = from(bucket: "example-bucket")
|
2020-02-25 16:43:08 +00:00
|
|
|
|> range(start: -1h)
|
|
|
|
|> filter(fn: (r) =>
|
2020-03-03 18:25:00 +00:00
|
|
|
r._measurement == "example-measurement" and
|
|
|
|
r._field == "example-field"
|
2020-02-25 16:43:08 +00:00
|
|
|
)
|
|
|
|
```
|
2020-03-03 18:25:00 +00:00
|
|
|
{{% /note %}}
|
2020-02-25 16:43:08 +00:00
|
|
|
|
2020-03-06 15:40:37 +00:00
|
|
|
## Flux query guides
|
2020-02-25 16:43:08 +00:00
|
|
|
|
2020-04-27 16:53:27 +00:00
|
|
|
{{< children type="anchored-list" pages="all" >}}
|
|
|
|
|
2020-03-03 18:25:00 +00:00
|
|
|
---
|
2020-02-25 16:43:08 +00:00
|
|
|
|
2020-04-27 16:53:27 +00:00
|
|
|
{{< children pages="all" readmore=true hr=true >}}
|