Documentation ¶
Index ¶
- type Client
- type ClientFactory
- type ConnectionState
- type MQTTConsumer
- func (m *MQTTConsumer) Description() string
- func (m *MQTTConsumer) Gather(_ telegraf.Accumulator) error
- func (m *MQTTConsumer) Init() error
- func (m *MQTTConsumer) SampleConfig() string
- func (m *MQTTConsumer) SetParser(parser parsers.Parser)
- func (m *MQTTConsumer) Start(acc telegraf.Accumulator) error
- func (m *MQTTConsumer) Stop()
- type TopicParsingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type ClientFactory func(o *mqtt.ClientOptions) Client
type ConnectionState ¶
type ConnectionState int
const ( Disconnected ConnectionState = iota Connecting Connected )
type MQTTConsumer ¶
type MQTTConsumer struct { Servers []string `toml:"servers"` Topics []string `toml:"topics"` TopicTag *string `toml:"topic_tag"` TopicParsing []TopicParsingConfig `toml:"topic_parsing"` Username string `toml:"username"` Password string `toml:"password"` QoS int `toml:"qos"` ConnectionTimeout config.Duration `toml:"connection_timeout"` MaxUndeliveredMessages int `toml:"max_undelivered_messages"` // Legacy metric buffer support; deprecated in v0.10.3 MetricBuffer int PersistentSession bool ClientID string `toml:"client_id"` tls.ClientConfig Log telegraf.Logger // contains filtered or unexported fields }
func New ¶
func New(factory ClientFactory) *MQTTConsumer
func (*MQTTConsumer) Description ¶
func (m *MQTTConsumer) Description() string
func (*MQTTConsumer) Gather ¶
func (m *MQTTConsumer) Gather(_ telegraf.Accumulator) error
func (*MQTTConsumer) Init ¶
func (m *MQTTConsumer) Init() error
func (*MQTTConsumer) SampleConfig ¶
func (m *MQTTConsumer) SampleConfig() string
func (*MQTTConsumer) SetParser ¶
func (m *MQTTConsumer) SetParser(parser parsers.Parser)
func (*MQTTConsumer) Start ¶
func (m *MQTTConsumer) Start(acc telegraf.Accumulator) error
func (*MQTTConsumer) Stop ¶
func (m *MQTTConsumer) Stop()
type TopicParsingConfig ¶ added in v1.21.0
type TopicParsingConfig struct { Topic string `toml:"topic"` Measurement string `toml:"measurement"` Tags string `toml:"tags"` Fields string `toml:"fields"` FieldTypes map[string]string `toml:"types"` // cached split of user given information MeasurementIndex int SplitTags []string SplitFields []string SplitTopic []string }
Click to show internal directories.
Click to hide internal directories.