Error message with MQTT and JSON

Hello,

I have a quit simple config file to write two values into InfluxDB. It works ok since 2 month and writes the two values “Zaehler_Stand” and “Zaeler_Verbrauch” into the database. But nevertheless I have continuously error messages and I do not know why. Has anyone an idea?
Thanks for your help.

MQTT Input
{
“Time” : “2023-11-09T17:36:37”,
“Main” : {
“power” : 519,
“counter” : 17060.773
}
}

telegraf config

###############################################################################

INPUT PLUGINS

###############################################################################

[[inputs.mqtt_consumer]]
servers = [“tcp://192.xxx.xxx.xx:1883”]
name_override = “Hichi”

topics = [“tele/tasmota/#”]

data_format = “json_v2”

[[inputs.mqtt_consumer.topic_parsing]]
topic = “tele/tasmota/Hichi/SENSOR”

[[inputs.mqtt_consumer.json_v2]]
[[inputs.mqtt_consumer.json_v2.field]]
path = “Main.power”
rename = “Zaehler_Verbrauch”
type = “int”
[[inputs.mqtt_consumer.json_v2.field]]
path = “Main.counter”
rename = “Zaehler_Stand”
type = “float”

Error messages

Feb 25 11:01:05 Raspi4 telegraf[552]: 2024-02-25T11:01:05Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
Feb 25 11:01:06 Raspi4 telegraf[552]: 2024-02-25T11:01:06Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
Feb 25 11:01:07 Raspi4 telegraf[552]: 2024-02-25T11:01:07Z D! [parsers.json_v2::mqtt_consumer] the path “Main.power” doesn’t exist
Feb 25 11:01:07 Raspi4 telegraf[552]: 2024-02-25T11:01:07Z E! [inputs.mqtt_consumer] Error in plugin: the path “Main.power” doesn’t exist
Feb 25 11:01:07 Raspi4 telegraf[552]: 2024-02-25T11:01:07Z D! [parsers.json_v2::mqtt_consumer] the path “Main.power” doesn’t exist

This means the data you received does not have a path for “Main.power”. You can ignore this if you don’t mind ignoring that data, or even mark it optional.

It is clear, that is means, there is no path “Main.power”. But if you can see in the MQTT input, the path exists and the datas are received and and after renaming into “Zaehler_Verbrauch” stored into the database.

This is the reason, why I am confused, an error message , but a correct behaviour. And this error message appears about 200 times per hour.

Then use the value processor + outputs.file and see what data you are actually getting. You may be getting messages that don’t actually have that path.