Hi, i am using telegraf to parse json data and push to influxdb. Below is the json data:
{
"BID": "1032",
"FID": "cslabec32-1032",
"beginTime": "1646053853",
"counters": {
"1": {
"OR.END": {
"A": "1.00"
},
"OR.ENDC": {
"B": "2.00"
}
},
"app": {
"OR.END": {
"C": "3.00",
"D": "4.00",
"E": "5.00"
}
}
},
"endTime": "1646054153",
}
Telegraf configuration:
[[processors.unpivot]]
order = 1
tag_key = "name"
value_key = "value"
[[processors.pivot]]
order = 2
tag_key = "name"
value_key = "value"
The output i am getting is:
measurement,BID=1032,FID=cslabec32-1032 counters_1_OR.END.A = 1i 1646053853000000000
measurement,BID=1032,FID=cslabec32-1032 counters_1_OR.ENDC.B = 2i 1646053853000000000
measurement,BID=1032,FID=cslabec32-1032 counters_app_OR.END.C = 3i 1646053853000000000
measurement,BID=1032,FID=cslabec32-1032 counters_app_OR.END.D = 4i 1646053853000000000
measurement,BID=1032,FID=cslabec32-1032 counters_app_OR.END.E = 5i 1646053853000000000
Expected output:
measurement,BID=1032,FID=cslabec32-1032 counters_1_OR.END.A = 1i,counters_1_OR.ENDC.B = 2i,counters_1_OR.END.C = 3i,counters_1_OR.END.D = 4i,counters_1_OR.END.E = 5i 1646053853000000000
Basically after doing unpivot and pivot i am not able to get 1 series with all fields. How can i achieve that?
Thanks