
FluxQuery
Execute a Flux query against InfluxDB.
Execute a Flux query against InfluxDB.
Query InfluxDB using Flux language.
Execute a Flux query against InfluxDB.
type: "io.kestra.plugin.influxdb.FluxQuery"Examples
Query data from InfluxDB and store as ION file
id: influxdb_flux_query
namespace: company.team
tasks:
- id: query_influxdb
type: io.kestra.plugin.influxdb.FluxQuery
connection:
url: "{{ secret('INFLUXDB_URL') }}"
token: "{{ secret('INFLUXDB_TOKEN') }}"
org: "my-org"
query: |
from(bucket: "my-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "cpu")
|> yield()
fetchType: STORE
Query data from InfluxDB and return all rows in execution output.
id: influxdb_flux_query_inline
namespace: company.team
tasks:
- id: query_influxdb
type: io.kestra.plugin.influxdb.FluxQuery
connection:
url: "{{ secret('INFLUXDB_URL') }}"
token: "{{ secret('INFLUXDB_TOKEN') }}"
org: "my-org"
query: |
from(bucket: "my-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "cpu")
|> limit(n: 10)
|> yield()
fetchType: FETCH
Query data from InfluxDB and return only the first row.
id: influxdb_flux_query_one
namespace: company.team
tasks:
- id: query_influxdb
type: io.kestra.plugin.influxdb.FluxQuery
connection:
url: "{{ secret('INFLUXDB_URL') }}"
token: "{{ secret('INFLUXDB_TOKEN') }}"
org: "my-org"
query: |
from(bucket: "my-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "cpu")
|> limit(n: 1)
|> yield()
fetchType: FETCH_ONE
Properties
connection*RequiredNon-dynamic
InfluxDB connection properties.
io.kestra.plugin.influxdb.InfluxDBConnection
InfluxDB token
The authentication token for InfluxDB
InfluxDB server URL
The URL of the InfluxDB server
org*Requiredstring
InfluxDB organization.
The organization to use for operations.
query*Requiredstring
Query to execute
Query to run against InfluxDB
bucketstring
InfluxDB bucket.
The bucket to use for operations.
fetchTypestring
NONESTOREFETCHFETCH_ONENONEThe way you want to store the data.
FETCH_ONE output the first row, FETCH output all the rows, STORE store all rows in a file, NONE do nothing.
Outputs
rowobject
Map containing the first row of fetched data.
Only populated if using fetchType=FETCH_ONE.
rowsarray
List containing the fetched data.
Only populated if using fetchType=FETCH.
sizeinteger
The number of rows fetched.
totalinteger
The total number of the rows fetched without pagination.
uristring
uriThe URI of the stored data.
Only populated if using fetchType=STORE.
Metrics
recordscounter
countThe number of records returned by the query