From c08b454af4a2b3816e73a09905cef771be517ae0 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Mon, 11 Feb 2019 17:25:25 -0800 Subject: [PATCH] Fix typos in mqtt output documentation --- plugins/outputs/mqtt/README.md | 11 +++++------ plugins/outputs/mqtt/mqtt.go | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/plugins/outputs/mqtt/README.md b/plugins/outputs/mqtt/README.md index 697418218..38eec7c3b 100644 --- a/plugins/outputs/mqtt/README.md +++ b/plugins/outputs/mqtt/README.md @@ -32,14 +32,13 @@ This plugin writes to a [MQTT Broker](http://http://mqtt.org/) acting as a mqtt # tls_key = "/etc/telegraf/key.pem" ## Use TLS but skip chain & host verification # insecure_skip_verify = false - + ## When true, metrics will be sent in one MQTT message per flush. Otherwise, ## metrics are written one metric per MQTT message. # batch = false - - ## When true, metric will have RETAIN flag set, making broker cache entries until someone - ## actually reads it - # retain = flase + + ## When true, messages will have RETAIN flag set. + # retain = false ## Data format to output. # data_format = "influx" @@ -60,5 +59,5 @@ This plugin writes to a [MQTT Broker](http://http://mqtt.org/) acting as a mqtt * `tls_cert`: TLS CERT * `tls_key`: TLS key * `insecure_skip_verify`: Use TLS but skip chain & host verification (default: false) -* `retain`: Set `retain` flag when publishing, instructing server to cache metric until someone reads it (default: false) +* `retain`: Set `retain` flag when publishing * `data_format`: [About Telegraf data formats](https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md) diff --git a/plugins/outputs/mqtt/mqtt.go b/plugins/outputs/mqtt/mqtt.go index 55d9532db..bacdd3b0e 100644 --- a/plugins/outputs/mqtt/mqtt.go +++ b/plugins/outputs/mqtt/mqtt.go @@ -6,13 +6,12 @@ import ( "sync" "time" + paho "github.com/eclipse/paho.mqtt.golang" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/internal" "github.com/influxdata/telegraf/internal/tls" "github.com/influxdata/telegraf/plugins/outputs" "github.com/influxdata/telegraf/plugins/serializers" - - paho "github.com/eclipse/paho.mqtt.golang" ) var sampleConfig = ` @@ -49,10 +48,10 @@ var sampleConfig = ` ## When true, metrics will be sent in one MQTT message per flush. Otherwise, ## metrics are written one metric per MQTT message. # batch = false - + ## When true, metric will have RETAIN flag set, making broker cache entries until someone ## actually reads it - # retain = flase + # retain = false ## Data format to output. ## Each data format has its own unique set of configuration options, read @@ -72,7 +71,7 @@ type MQTT struct { ClientID string `toml:"client_id"` tls.ClientConfig BatchMessage bool `toml:"batch"` - Retain bool + Retain bool `toml:"retain"` client paho.Client opts *paho.ClientOptions