Telegraf and enriching input data


Does Telegraf supports enriching (adding some fields coming from a json file or similar) incoming MQTT messages? Otherwise I have to stick with an own build MQTT subscriber.


Telegraf supports adding tags to any point using the tags input parameter. You can set these using environment variables so often one will define the variables in /etc/default/telegraf and then use these in the telegraf.conf:

  ... snip ...
    foo = "$BAR"

Ok thanks.
But what if $BAR is dependent on an incoming value of the MQTT payload?
E.g. I want to determine the accountID (not part of the payload) to which a deviceID (part of the payload) belongs? Can I achieve this with Telegraf?

Sorry, Telegraf cannot do this currently.