
InfluxDB FluxQuery
CertifiedRun Flux query against InfluxDB
InfluxDB FluxQuery
Run Flux query against InfluxDB
Executes a Flux query for a given organization. The bucket parameter is ignored because the query embeds it; fetchType controls whether rows are returned, stored as ION, or only counted.
type: io.kestra.plugin.influxdb.FluxQueryExamples
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
Connection settings (URL, token, optional options) reused across tasks
io.kestra.plugin.influxdb.InfluxDBConnection
InfluxDB token
The authentication token for InfluxDB
InfluxDB server URL
The URL of the InfluxDB server
PT10SConnection timeout.
Connection establishment timeout (ISO-8601 duration, e.g. PT10S). Default is 10 seconds.
PT10SRead timeout.
Maximum time to wait for response bytes (including initial response) (ISO-8601 duration, e.g. PT10S). Default is 10 seconds.
org *Requiredstring
Organization name
Organization scope for queries and writes
query *Requiredstring
Query string
Flux or InfluxQL statement to run against InfluxDB
bucket string
Bucket name
Target bucket for write/query operations when required; ignored by Flux queries
fetchType string
NONESTOREFETCHFETCH_ONENONEFetch behavior
FETCH_ONE returns the first row, FETCH returns all rows, STORE writes rows to an ION file, NONE only records metrics; default is NONE
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
Outputs
row object
First fetched row
Only populated when fetchType=FETCH_ONE
rows array
Fetched rows
Only populated when fetchType=FETCH
size integer
Number of rows returned
total integer
Total rows without pagination
uri string
uriURI of stored data
Only populated when fetchType=STORE
Metrics
records counter
countThe number of records returned by the query