telegraf/plugins/inputs/mqtt_consumer
Cameron Sparr ee468be696 Flush based on buffer size rather than time
this includes:
- Add Accumulator to the Start() function of service inputs
- For message consumer plugins, use the Accumulator to constantly add
  metrics and make Gather a dummy function
- rework unit tests to match this new behavior.
- make "flush_buffer_when_full" a config option that defaults to true

closes #666
2016-02-16 22:25:22 -07:00
..
README.md MQTT Consumer Input plugin 2016-02-12 11:13:32 -07:00
mqtt_consumer.go Flush based on buffer size rather than time 2016-02-16 22:25:22 -07:00
mqtt_consumer_test.go Flush based on buffer size rather than time 2016-02-16 22:25:22 -07:00

README.md

MQTT Consumer Input Plugin

The MQTT consumer plugin reads from specified MQTT topics and adds messages to InfluxDB. The plugin expects messages in the Telegraf Input Data Formats.

Configuration:

# Read metrics from MQTT topic(s)
[[inputs.mqtt_consumer]]
  servers = ["localhost:1883"]
  ### MQTT QoS, must be 0, 1, or 2
  qos = 0

  ### Topics to subscribe to
  topics = [
    "telegraf/host01/cpu",
    "telegraf/+/mem",
    "sensors/#",
  ]

  ### Maximum number of metrics to buffer between collection intervals
  metric_buffer = 100000

  ### username and password to connect MQTT server.
  # username = "telegraf"
  # password = "metricsmetricsmetricsmetrics"

  ### Optional SSL Config
  # ssl_ca = "/etc/telegraf/ca.pem"
  # ssl_cert = "/etc/telegraf/cert.pem"
  # ssl_key = "/etc/telegraf/key.pem"
  ### Use SSL but skip chain & host verification
  # insecure_skip_verify = false

  ### Data format to consume. This can be "json", "influx" or "graphite"
  ### Each data format has it's own unique set of configuration options, read
  ### more about them here:
  ### https://github.com/influxdata/telegraf/blob/master/DATA_FORMATS_INPUT.md
  data_format = "influx"

Tags:

  • All measurements are tagged with the incoming topic, ie topic=telegraf/host01/cpu