I have telegraf successfully up and running on a raspi, feeding system data into influxdb for grafana.
My question is, I have a service on that pi that provides a json file with all kind of stats about itself via http, how do i get that into the same influxdb as measurements?
Hello @lemmy04 ,
Have you taken a look at metrics filtering for telegraf?
Specifically fieldpass = ["d11_map_size"]
Also I recommend setting debug = true in the agent portion of your config. Finally, I like to
test that the data is being sent to InfluxDB, run the following (replacing telegraf.conf with the path to your configuration file):
telegraf -config ~/telegraf.conf -test
Have you tried that? If so can you share the resulting line protocol?
Your values are all in string format.
The keys of values containing strings must be explicitly named to the json parser, otherwise they will apparently not be read.
I have added the processor plugin to turn the string into an integer.
You can omit this if you want to process the value as a string.
urls = ["https://susepaste.org/view/raw/15081925"]
method = "GET"
name_override = "fr24"
data_format = "json"
json_string_fields = ["d11_map_size"]
fieldpass = ["d11_map_size"]
# Convert string to unsigned value type
unsigned = ["d11_map_size"]
[[outputs.file]] # only for debugging
files = ["dump1090.out"]
influx_sort_fields = true