Not able to use aggregator plugin properly

Hi.
I am ingesting below json data to my telegraf:

{
    "BID": "1032",
    "FID": "1032cucp1",
    "beginTime": "1647453339",
    "counters": {
       "app": {
          "OR.ENDC": {
             "SgnbAddAttempt.eNB.0": "0.00",
             "SgnbAddAttempt.eNB.1": "0.00",
             "SgnbAddAttempt.eNB.2": "0.00",
             "SgnbAddAttempt.eNB.3": "0.00"
          }
       }
    },
    "endTime": "1647436278",
    "senderType": "CU-CP",
    "Version": "6.0.0"
 }
 

After applying a set of processor plugin i am getting following data:

om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.3,senderType=CU-CP,Version=6.0.0 OR_ENDC_SgnbAddAttempt.eNB_3=0i 1647453339000000000
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.0,senderType=CU-CP,Version=6.0.0 OR_ENDC_SgnbAddAttempt.eNB_0=0i 1647453339000000000
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.2,senderType=CU-CP,Version=6.0.0 OR_ENDC_SgnbAddAttempt.eNB_2=0i 1647453339000000000
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.1,senderType=CU-CP,Version=6.0.0 OR_ENDC_SgnbAddAttempt.eNB_1=0i 1647453339000000000

Now i want to apply aggregate merge plugin in order to combine fields. Since here all measurement and tag name are same except method and name tag. So i am using tagexclude to exclude them.

[[aggregators.merge]]
  ## If true, the original metric will be dropped by the
  ## aggregator and will not get sent to the output plugins.
  # taginclude = ["GNBID","VNFID","cell","cluster_id","host","senderType","swVersion"]
  tagexclude = ["name","method"]
  drop_original = true
  period = "3m"
  delay = "3m"
  grace = "3m"

The actual vs expected output:

**Actual output:**
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.3,senderType=CU-CP,Version=6.0.0 value=0i 1647453339000000000
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.0,senderType=CU-CP,Version=6.0.0 value=0i 1647453339000000000
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.2,senderType=CU-CP,Version=6.0.0 value=0i 1647453339000000000
om,BID=1032,FID=1032cucp1,cell=app,method=counters_a,name=counters_app_OR.ENDC_SgnbAddAttempt.eNB.1,senderType=CU-CP,Version=6.0.0 value=0i 1647453339000000000
**Expected output:**
om,BID=1032,FID=1032cucp1,cell=app,senderType=CU-CP,Version=6.0.0 OR_ENDC_SgnbAddAttempt.eNB_0=0i,OR_ENDC_SgnbAddAttempt.eNB_1=0i,OR_ENDC_SgnbAddAttempt.eNB_2=0i,OR_ENDC_SgnbAddAttempt.eNB_3=0i 1647453339000000000

According to me tagexclude should work and since all other tags except method and name are same we should be getting multiple field in single series.

Is there anything wrong with what i am doing here?

Thanks

I’d try to move tagexclude in a previous step, as I’m not sure about how it behaves inside the aggregators.merge. (even tho it should work)
Since you don’t need the data since the beginning remove it as soon as possible, if needed you can use the processor.override which allows you to apply all functions that can apply to inputs or aggregators.