Hi there everyone,
I am a newbie to Telegraf. I have an MQTT feed from a LoRaWAN Application server which I have successfully subcribed to using Telegraf. I am having issue with getting telegraf to recogise the values which are held within in ‘inner arrays’. I have a sample of the data feed below. Any help would be greatly appreciated. The key fields I wish to tag are ‘applicationid’, ‘nodeName’, ‘rssi’, ‘name’ and ‘data’.
I get the below error:
Oct 03 11:34:28 connxtinflux1 telegraf[2510]: message: {“applicationID”:“1”,“applicationName”:“RHF1S001”,“nodeName”:“House2”,“devEUI”:“0101010101010101”,“rxInfo”:[{“mac”:“b827ebfffe******”,“rssi”:-120,“loRaSNR”:-4.5,“name”:“LoRaWAN-38”,“latitude”:54.86658090934141,“longitude”:-6.16727828979
Oct 03 11:34:28 connxtinflux1 telegraf[2510]: error: metric parsing error, reason: [missing tag value], buffer: [{“applicationID”:“1”,“applicationName”:“RHF1S001”,“nodeName”:“House2”,“devEUI”:“0101010101010101”,“rxInfo”:[{“mac”:“b827ebfffe******”,“rssi”:-120,“loRaSNR”:-4.5,“name”:"LoRaWAN-
The raw data being presented through the MQTT feed is below:
{“applicationID”:“1”,“applicationName”:“RHF1S001”,“nodeName”:“House2”,“devEUI”:“0101010101010101”,“rxInfo”:[{“mac”:“b827ebfffe******”,”rssi”:-120,“loRaSNR”:-4.5,“name”:“LoRaWAN-38”,“latitude”:54.86658090934141,“longitude”:-6.167278289794922,“altitude”:170}],“txInfo”:{“frequency”:868300000,“dataRate”:{“modulation”:“LORA”,“bandwidth”:125,“spreadFactor”:12},“adr”:true,“codeRate”:“4/5”},“fCnt”:668,“fPort”:8,“data”:“ARBclsIB//+/”}
My telegraf.conf file looks like:
# Read metrics from MQTT topic(s)
[[inputs.mqtt_consumer]]
servers = [“..*.:1883”]
## MQTT QoS, must be 0, 1, or 2
qos = 0
## Topics to subscribe to
topics = [
“application/#”,
]
# if true, messages that can’t be delivered while the subscriber is offline
# will be delivered when it comes back (such as on service restart).
# NOTE: if true, client_id MUST be set
persistent_session = true
connection_timeout = 30
# If empty, a random client ID will be generated.
client_id = “*********-telegraf-01”
## username and password to connect MQTT server.
username = “"
password = "*”
## Optional SSL Config
# ssl_ca = “/etc/telegraf/ca.pem”
# ssl_cert = “/etc/telegraf/cert.pem”
# ssl_key = “/etc/telegraf/key.pem”
## Use SSL but skip chain & host verification
# insecure_skip_verify = false
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## telegraf/DATA_FORMATS_INPUT.md at master · influxdata/telegraf · GitHub
data_format = “”
tag_keys = [
“ApplicationID”,
“nodeName”,
“data”
]