Relevant telegraf.conf:
[[inputs.mqtt_consumer]]
servers = ["tcp://localhost:1883"]
qos = 0
connection_timeout = "30s"
topics = [
"test/#"
]
tag_keys = ["tag"]
persistent_session = false
client_id = ""
data_format = "json"
json_name_key = "name"
json_query = "values"
[[outputs.influxdb]]
urls = ["http://localhost:8086"]
database = "test_db"
skip_database_creation = false
System info:
Telegraf version: 1.13.2
Environments: Linux mint, running a docker contariner with telegraf 1.13.2.
Steps to reproduce:
-
Send this json on mqtt, with mqtt_consumer configurated like described above:
{
"name": "test_name",
"timestamp": "2020-Feb-05 08:06:56.976",
"values": {
"temp_outside": 0.05285325646400452,
"temp_indside": 0.007113146595656872
}
}
-
The measurement name is not the value of the json key "name".
Expected behavior:
Measurement should be named according to the name key in the json message.
Actual behavior:
The measurement name is "mqtt_consumer", not the value in the "name" key.
Additional info:
If I comment out json_query, I get a measurement called "test_name" (like expected), but then i get "values_" as a prefix for all the field_keys ("values_temp_outside" and "values_temp_indside").
Relevant telegraf.conf:
System info:
Telegraf version: 1.13.2
Environments: Linux mint, running a docker contariner with telegraf 1.13.2.
Steps to reproduce:
Send this json on mqtt, with mqtt_consumer configurated like described above:
{
"name": "test_name",
"timestamp": "2020-Feb-05 08:06:56.976",
"values": {
"temp_outside": 0.05285325646400452,
"temp_indside": 0.007113146595656872
}
}
The measurement name is not the value of the json key "name".
Expected behavior:
Measurement should be named according to the name key in the json message.
Actual behavior:
The measurement name is "mqtt_consumer", not the value in the "name" key.
Additional info:
If I comment out json_query, I get a measurement called "test_name" (like expected), but then i get "values_" as a prefix for all the field_keys ("values_temp_outside" and "values_temp_indside").