An opinionated and intentionally scope-limited MQTT to InfluxDB bridge.
Note
This README is incomplete (tracked in #1).
- Get simple JSON data from MQTT to InfluxDB
- Straightforward; easy to learn about, configure, and run
- Take advantage of orchestration features from e.g. systemd or Docker Compose
- Allow health monitoring via an outgoing heartbeat, HTTP GET, and/or Docker's health check
tk orchestration, retries, etc
tk can't necessarily work with every message format can't necessarily work with weird key names or most nested structures doesn't support non-JSON
tk
tk
-env-files-strict-help-version
note, strict overrides FIELDTAG_DETERMINATION_FAILURE and CAST_FAILURE
tk
The timestamp for each InfluxDB point defaults to the time the message was processed.
If the message contains a top-level entry named at, ts, or time, that value will be parsed and used as the timestamp.
tk: -M time:iso:utc:tz
tk
per The Open Group Base Specifications https://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html , any char other than NUL or = is allowed in an env var name.
Influx disallows(ish) ( https://docs.influxdata.com/influxdb/v1/write_protocols/line_protocol_reference/#special-characters ): #, and the names time, _field, _measurement.
For sanity I also disallow ASCII control chars (character code 0-31). And I recommend you don't use periods (.) or mixed case as that could cause collisions.
lowercased except in env vars, when they're all uppercased.
tk
tk
MQTT_SERVERMQTT_TOPICMQTT_USERMQTT_PASSMQTT_QOSMQTT_CLIENT_IDMQTT_CLEAN_STARTMQTT_KEEP_ALIVE_SMQTT_SESSION_EXPIRY_S
tk
INFLUX_SERVERINFLUX_USERINFLUX_PASSINFLUX_BUCKETINFLUX_MEASUREMENT_NAMEINFLUX_TIMEOUT_SINFLUX_RETRIESINFLUX_TAGS
tk
Typically, we auto TK
Format: M2I_<canonicalized-name>_ISA=<field|tag|drop>
FIELDTAG_DETERMINATION_FAILURE:ignore,log, orfatal
tk
Format: M2I_<canonicalized-field-name>_TYPE=<int|float|double|string|bool>
CAST_FAILURE:ignore,log, orfatalDEFAULT_NUMBERS_TO_FLOAT:trueorfalse
tk
HEARTBEAT_GET_URLHEARTBEAT_INTERVAL_SHEARTBEAT_THRESHOLD_SHEALTH_PORT
If a message contains a timestamp field, it must be a string and will be parsed as an RFC3339 timestamp.
Note
Timestamps from an Apple platform formatted as NSISO8601DateFormatWithInternetDateTime will be parsed correctly by this program.
In the future, multiple timestamp formats may be supported; see #3.
tk; for JSON mode only
DEDUPE_ON
tk
This software is licensed under the LGPL-3.0 license. See LICENSE in this repo.
Chris Dzombak