Live streams
Collector: InfluxDB
Read measurements from InfluxDB 2.x (Flux) or 1.x (InfluxQL), incrementally and for any past range.
InfluxDB
Reads time series out of an InfluxDB that already holds them (Telegraf, Node-RED and historian-style stacks), with the Flux API of InfluxDB 2.x or the InfluxQL API of 1.x. Nothing is repeated or lost across restarts, and backfill reads any past range.
streams:
- name: Customer A
mode: live # live | record (also kept in the cloud)
sources:
- name: Customer InfluxDB 2
type: influx
url: https://influx.customer.local:8086
api: flux # InfluxDB 2.x
token: env:INFLUX_TOKEN # a read-only API token
org: customer
bucket: telemetry
series:
- measurement: cpu
fields: [usage, temp]
where: {dc: line1} # tag = value filters
group_by: [host] # one channel per host
- name: Legacy InfluxDB 1
type: influx
url: https://influx1.customer.local:8086
api: influxql # InfluxDB 1.x (and the v1 endpoint of 3.x)
database: telemetry
user: reader
password: env:INFLUX_PASSWORD
series:
- {measurement: pump, fields: [flow, pressure], group_by: [unit]}| Name | Type | Description |
|---|---|---|
urlrequired | string | The server. https:// by default; http:// needs allow_http. |
api | flux | influxqlDefault: flux | flux: POST /api/v2/query. influxql: GET /query. |
token, org, bucket | string | flux: all three required. Use a read-only token (env:VAR or file:path). |
database, rp, user, password | string | influxql: database required; rp is the retention policy; user and password when authentication is on. |
seriesrequired | list | What to read. Each entry: measurement, fields (numbers or booleans), where (tag filters, equality) and group_by (tags that split the measurement into channels). |
poll_ms | numberDefault: 5000 | Polling interval. |
overlap_s | numberDefault: 60 | How late a point may arrive behind the newest one and still be read (Telegraf flushes every 10 s by default, plus jitter); duplicates are dropped. A later point is lost; a larger value re-reads more on every poll. |
lookback_s | numberDefault: 0 | On the first start, how far back to read (otherwise just the last poll interval). |
history_chunk_s | numberDefault: 3600 | The longest range one query asks for, in backfill and the catch-up after downtime. |
discover_s, max_tags | numberDefault: 3600, 5000 | discover lists the channels that have points in the last discover_s seconds; channels beyond max_tags are dropped and counted. |
ca, insecure, allow_http, timeout_s | mixed | As in the REST source. |
Channels are named measurement.field, plus ,tag=value for each group_by tag (cpu.usage,host=a). String fields are dropped and counted (strings_dropped). An InfluxQL answer cut short by the server's max-row-limit is asked again in smaller windows (partial_results); if even one second is cut, the log says rows were lost. Health reports connected (1 after a successful query, 0 after a failed one). Without group_by, series that differ only by tags share one channel, so list the tags that tell them apart.