InfluxDB: Flux - Query remote InfluxDB

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche

InfluxDB 2.x can query remote InfluxDB sources with the Flux function from().
From() cannot retrieve data from remote InfluxDB OSS 1.x or InfluxDB Enterprise 1.x data sources

To query remote InfluxDB sources, include the host, token, and org (or orgID) parameters.

Example

token = "<YOUR_TOKEN>"

from(
  bucket: "<YOUR_BUCKET>",
  host: "https://<YOUR_INFLUXDB-INSTANCE>:8086",
  org: "<YOUR_ORGANISATION>",
  token: token
)
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "<YOUR_MEASUREMENT>")
  ..