InfluxDB: Flux - Query remote InfluxDB

Aus Wiki-WebPerfect
Version vom 3. Februar 2022, 09:49 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

InfluxDB 2.x can query remote InfluxDB sources with the Flux function from().
From() can retrieve data from remote InfluxDB OSS 1.7+ or InfluxDB Enterprise 1.9+ data sources but not the opposite way.

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>")
  ..


More information's: https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/from/