I am using telegraf 1.22 for reading the data from the MQTT broker and it forms a connection with every topic.
MQTT broker getting restarted from some time the reason is telegraf forming much connection to MQTT broker and which is why MQTT is facing too much load from telegraf.
Now, I want to print all the topic names that are forming connections to the telegraf to exclude those I don’t require.
my telegraf configuration.
[[inputs.mqtt_consumer]]
#servers = ["hostURL"]
qos = 0
topics = ["#"]
## The message topic will be stored in a tag specified by this value. If set
## to the empty string no topic tag will be created.
# topic_tag = "topic"
## QoS policy for messages
## 0 = at most once
## 1 = at least once
## 2 = exactly once
##
## When using a QoS of 1 or 2, you should enable persistent_session to allow
## resuming unacknowledged messages.
# qos = 0
## Connection timeout for initial connection in seconds
connection_timeout = "30s"
## Maximum messages to read from the broker that have not been written by an
## output. For best throughput set based on the number of metrics within
## each message and the size of the output's metric_batch_size.
##
## For example, if each message from the queue contains 10 metrics and the
## output metric_batch_size is 1000, setting this to 100 will ensure that a
## full batch is collected and the write is triggered immediately without
## waiting until the next flush_interval.
# max_undelivered_messages = 1000
## Persistent session disables clearing of the client session on connection.
## In order for this option to work you must also set client_id to identify
## the client. To receive messages that arrived while the client is offline,
## also set the qos option to 1 or 2 and don't forget to also set the QoS when
## publishing.
# persistent_session = false
## If unset, a random client ID will be generated.
client_id = "telegraf_oss"
## Username and password to connect MQTT server.
username = "username"
password = "password "
name_override = "mqtt_data"
Thanks