Telegraf and enriching input data

Hi,

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.

Thanks.

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:

[[inputs.mqtt_consumer]]
  ... snip ...
  [inputs.mqtt_consumer.tags]
    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.