Seeking help configuring telegraf

First hello and happy new year everyone.
Newbie here and seeking hellp configuring telegraf. I dont have a coding background, but I managed to configure it to get data from mqtt by going through some threads here.

I am trying to get some data from an arduino device which posts the metrics on it own page in json format. I have tried going through the instructions for influxdb.v2.listener, and http listener (those were the two plugins that made sense to me to use) with no luck. I am running influxdb2 on a raspberry pi.

this is what the data looks like, on the device’s ip address.
" {“battery_soc”:0,“battery_voltage”:0,“battery_charging_amps”:0,“battery_charging_watts”:0,“controller_temperature”:0,“battery_temperature”:0,“controller_temperatureF”:0,“battery_temperatureF”:0,“load_voltage”:0,“load_amps”:0,“load_watts”:0,“load_status”:false,“solar_panel_voltage”:0,“solar_panel_amps”:0,“solar_panel_watts”:0} "

thanks in advance for any help.


These plugins are listeners, which mean they expect data to get sent to them, so they listen for it.

I think what you want is the http plugin, which will query an HTTP endpoint and get data from it at each interval. Does that sound right?

Try that plugin. The next step you might need to do is parsing the data. The data looks like a flat JSON, so using the data_format = "json" for the original json parser, might be enough.

Give that a shot and let us know how far you get!

Thank you. that worked perfect. another question. given that now there is more than one configuration on telegraf, will they interfere with each other? do they run simultaneously with no problem? I can’t know that right now because the system the first configuration is for is down at the moment.

now there is more than one configuration

Telegraf runs each input and output independently of each other. Meaning you can have as many plugins as you want and they won’t conflict.

thanks again for taking the time to help me. It is greatly appreciated. I had already been scratching my head for a while with this one.

1 Like