How to send MQTT inputs to different outputs by topic


I have a system that receives different sensor data on different topics. I use Telegraf to store it in InfluxDB, but I also want some of that data to be sent using HTTP (only data received from “esp32/spots”). Is there a way of doing that?

This is my Telegraf input conf:

servers = [“tcp://”]
topics = [

You can use a tag to decide where to send the data. The topic can be added as a tag in the mqtt_consumer using the topic_tag option or you could add a static tag using the tags option. In the output you can configure the HTTP output to send only data with the tag using tagpass.

Here is the basic layout with only the routing options shown:

  topic_tag = "topic"

  # everything will go here, if you want to exclude the "esp32/spots" topic
  # you would use tagdrop here.

    topic = ["esp32/spots"]

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.