The imeptus for this is to allow embedding an event timestamp with the data, since MQTT doesn't tag messages with the time they were sent. So Instead of having a payload value like "some value", you could have: { "timestamp": 1630360029124, "value": "some value" } ... and then configure the mapping in mqtt2db to be a JSON mapping, with timestamp field name "timestamp" and value field name "value", and we just figure things out. If no mapping payload type is specified, we just assume it's a raw value as before.
22 lines
657 B
TOML
22 lines
657 B
TOML
[package]
|
|
name = "mqtt2db"
|
|
version = "0.1.0"
|
|
authors = ["Brian J. Tarricone <brian@tarricone.org>"]
|
|
edition = "2018"
|
|
|
|
[dependencies]
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
clap = "2.33"
|
|
env_logger = "0.9"
|
|
futures = "0.3"
|
|
influxdb = { version = "0.4", default-features = false, features = ["derive", "use-serde", "h1-client-rustls"] }
|
|
lazy_static = "1"
|
|
log = { version = "0.4", features = ["std", "serde"] }
|
|
regex = "1"
|
|
rumqttc = "0.8"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
serde_yaml = "0.8"
|
|
tokio = { version = "1", features = ["fs", "io-std", "io-util", "macros", "rt", "rt-multi-thread"] }
|
|
tokio-compat-02 = "0.2"
|