Hi there,
I’m new to influx and telegraf. I’m trying to send MQTT Publish to Telefgraf inputs.mqtt_consumer plugin.
I’m trying to use data_format = “influx” or data_format = “json” but i’m getting parsing errors in my log.
Does anyone have some examples sending MQTT with these formats ?
Hi,
Thank you for answer.
I already tried the combination sending a single value with MQTT using the data_format and data_type parameters, but my goal is to send more measurements values at the same time. For example in json format.
thanks,
Peter
# telegraf.conf
data_format = "json"
json_string_fields = ["txt_field_1"]
# mqtt sent without text field
mosquitto_pub -h localhost -m '{"temperature":25,"airpressure":1010,"humidity":77}' -t 'telegraf/test'
# mqtt sent with text field
mosquitto_pub -h localhost -m '{"temperature":26,"airpressure":1011,"humidity":78,"txt_field_1":"Testing"}' -t 'telegraf/test'
select * from mqtt_consumer
name: mqtt_consumer
time airpressure host humidity temperature topic txt_field_1