Incorrect inputs tpl for YAML <=> TMOL
zhenzh opened this issue · 3 comments
When I try to add an mqtt consumer input into the telegraf through helm installation, the helm chart can not correctly convert my yaml formated input configuration to tmol.
config:
inputs:
- mqtt_consumer:
topic_parsing:
measurement: test
The yaml below was converted to:
[[inputs.mqtt_consumer]]
[inputs.mqtt_consumer.topic_parsing] <------ which should be [[inputs.mqtt_consumer.topic_parsing]]
measurement = "test"
I have check your tpl definitions which is really complex and hard to fully consider all kinds of yaml to tmol cases. Why not directly using text format for config section to avoid thinking of complex converting between yaml and tmol?
Stumbled upon this as I had another issue when parsing my config.
You should be able to solve your issue by using a -
in front of measurement, I guess:
config:
inputs:
- mqtt_consumer:
topic_parsing:
- measurement: test
but you also probably should use the tplVersion=2 parameter, which helped me out, as topics were falsely placed after the [[inputs.mqtt_consumer.topic_parsing]]
otherwise
@MyChaOS87 You are correct. tplVersion=2 do works me. Really appreciate for your help.