hello
setup:
two sonoff pow r2 sendings mqtt data via mosquitto and telegraf to a single database on a raspberry pi
(see telegraf.conf and stored data in influxdb below).
question:
how can i alter the telegraf.conf file, so that data from the two different sonoff pow r2 (with different topics) are stored in two seperate databases on the raspberry pi?
many thanks
telegraf.conf
[global_tags]
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
#===============================================================================
[[outputs.influxdb]]
urls = ["http://raspberrypi:8086"]
database = "sensors"
[[inputs.mqtt_consumer]]
servers = ["tcp://raspberrypi:1883"]
topics = ["tele/solar/SENSOR","tele/Sonoff_PV001/SENSOR"]
data_format = "json"
influxdb data
select * from "mqtt_consumer" order by time desc Limit 6
name: mqtt_consumer
time ENERGY_ApparentPower ENERGY_Current ENERGY_Factor ENERGY_Period ENERGY_Power ENERGY_ReactivePower ENERGY_Today ENERGY_Total ENERGY_Voltage ENERGY_Yesterday host topic
---- -------------------- -------------- ------------- ------------- ------------ -------------------- ------------ ------------ -------------- ---------------- ---- -----
2022-03-08T09:42:10.479688066Z 1221 5.044 0.95 10 1158 386 2.045 1490.898 242 8.037 raspberrypi tele/solar/SENSOR
2022-03-08T09:42:09.549686515Z 890 3.671 0.97 7 867 199 1.624 75.186 242 5.458 raspberrypi tele/Sonoff_PV001/SENSOR
2022-03-08T09:41:40.575211802Z 1204 4.968 0.96 9 1153 348 2.036 1490.888 242 8.037 raspberrypi tele/solar/SENSOR
2022-03-08T09:41:39.553784115Z 882 3.642 0.98 7 860 192 1.617 75.179 242 5.458 raspberrypi tele/Sonoff_PV001/SENSOR
2022-03-08T09:41:10.504204597Z 1162 4.809 0.97 2 1125 291 2.026 1490.879 242 8.037 raspberrypi tele/solar/SENSOR
2022-03-08T09:41:09.639315037Z 870 3.612 0.98 7 851 177 1.61 75.172 241 5.458 raspberrypi tele/Sonoff_PV001/SENSOR
>
-----------------------------------------------------------------------------------------------------------------------------------------------------------