Open ghost opened 3 years ago
@danberg13 can you share a sample of your json you're querying?
yeah of course:
{
"cnt" : 23,
"data": [
3,
7,
10,
23
],
"format": 0
}
With the GJSON Path = "data" im getting just the last value.
@danberg13 I'm getting this as my output (reading in the sample JSON from a file)
> file,data=3 cnt=23i,format=0i 1626389159000000000
> file,data=7 cnt=23i,format=0i 1626389159000000000
> file,data=10 cnt=23i,format=0i 1626389159000000000
> file,data=23 cnt=23i,format=0i 1626389159000000000
Relevant telegraf.conf:
System info:
Telegraf Version 1.19.0, Linux Ubuntu 20.04, InfluxDB 1.8 and Grafana 7.5.4
Docker
Steps to reproduce:
Expected behavior:
Im testing the new json_v2 parser with InfluxDB and Grafana in a TIG-Stack configuration managed by docker. The old json parser gave me the array values as field values:
Actual behavior:
The new json parser doesn't allow arrays to get trough. The solution discussed in this issue #9381 only gives me the array values as tag values:
The GJSON Path should be "data". Thanks for the work @sspaink
Additional info: