Telegraf pivot and unpivot

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

Unless I am not seeing a difference, the output you are getting and the expected output are the same single series.

The measurement name, tags, and timestamp are all identical. The only difference between each row in your current output is the field. Not sure what you are using as an output, but in InfluxDB that would all be treated as the same series.

I was referring with regard to telegraf, telegraf will be counting in first case those 5 lines as 5 metrics and in second case it will be counting as 1 metric only. Which i think will effect my buffer limit and prevent from metrics getting dropped. Context for the question was for this : Slow down Telegraf ingestion - #2 by jpowers

Thanks