Hello !
We are trying to output our incoming data to different buckets using tagpass but it doesn’t seem to work. Everything is working inside containers. A Telegraf container is fetching data from a Mosquitto container and tries to send it to the influx (version 2.1.1) container.
We want to send:
input 1 → bucket 1
input 2 → bucket 2
input 3 → bucket 3
How can we get it to work? Do we need a default bucket?
The code:
[agent]
interval = "20ms"
round_interval = true
precision = "rfc3339"
#input 1 Y
[[inputs.mqtt_consumer]]
servers = ["tcp://e_mqtt:1883"]
topics = [
"Y/Schlafzimmer/power/SENSOR",
]
[inputs.mqtt_consumer.tags]
tag = "Y"
data_format = "json"
#input 2 X
[[inputs.mqtt_consumer]]
servers = ["tcp://e_mqtt:1883"]
topics = [
"X/001/pulse/RESULT",
"X/002/pulse/RESULT",
"X/003/pulse/RESULT",
"X/004/pulse/RESULT",
"X/005/pulse/RESULT",
"X/006/pulse/RESULT",
"X/007/pulse/RESULT",
"X/008/pulse/RESULT",
"X/009/pulse/RESULT",
"X/010/pulse/RESULT",
"X/011/pulse/RESULT",
"X/012/pulse/RESULT",
"X/013/pulse/RESULT",
"X/014/pulse/RESULT",
"X/015/pulse/RESULT",
]
[inputs.mqtt_consumer.tags]
tag = "X"
data_format = "json"
#input 3 Z
[[inputs.mqtt_consumer]]
servers = ["tcp://e_mqtt:1883"]
topics = [
"PowerMeter/001/power/SENSOR",
"PowerMeter/002/power/SENSOR",
]
[inputs.mqtt_consumer.tags]
tag = "Z"
data_format = "json"
#output für 1 Y
[[outputs.influxdb_v2]]
urls = ["http://e_influxdb:8086"]
token = "ULw91qCCOyBrVqwWyNdmy8ckzmJhjbrZMhgf57XmXp4elkFsf-atwpQ=="
organization = "my-org"
bucket = "Ybucket"
[outputs.influxdb_v2.tagpass]
tag = ["Y"]
#output für 2 X
[[outputs.influxdb_v2]]
urls = ["http://e_influxdb:8086"]
token = "ULw91qCCOyBrVqwWyNdmy8ckzmJhjbrZMhgf57XmXp4elkFsf-atwpQ=="
organization = "my-org"
bucket = "Xbucket"
tagexclude =["tag"]
[outputs.influxdb_v2.tagpass]
tag = ["X"]
#output für 3 Z
[[outputs.influxdb_v2]]
urls = ["http://e_influxdb:8086"]
token = "ULw91qCCOyBrVqwWyNdmy8ckzmJhjbrZMhgf57XmXp4elkFsf-atwpQ=="
organization = "my-org"
bucket = "Zbucket"
tagexclude =["tag"]
[outputs.influxdb_v2.tagpass]
tag = ["Z"]
Thank you!