The result of modifying the key name of the json format data will be doubled

JSON data

{
    "Time": "2024-06-25T06:20:03",
    "ENERGY": {
        "TotalStartTime": "2024-05-15T17:10:58",
        "Total": [
            206.965,
            291.411,
            473.815
        ],
        "Yesterday": [
            6.641,
            12.554,
            16.117
        ],
        "Today": [
            0.698,
            4.113,
            4.264
        ],
        "Period": [
            0,
            0,
            2
        ],
        "Power": [
            30,
            242,
            661
        ],
        "ApparentPower": [
            57,
            328,
            680
        ],
        "ReactivePower": [
            49,
            221,
            162
        ],
        "Factor": [
            0.52,
            0.74,
            0.97
        ],
        "Frequency": [
            50,
            50,
            50
        ],
        "Voltage": [
            225,
            225,
            225
        ],
        "Current": [
            0.255,
            1.453,
            3.021
        ]
    }
}

Telegraf Config

[[outputs.file]]
  files = ["stdout", "/root/out.txt"]
  data_format = "influx"

[[inputs.mqtt_consumer]]
  servers = ["tcp://172.30.1.135:1883"]
  topics = [
    "tele/pezm_584143/SENSOR"
  ]
  qos = 0
  username = ""
  password = ""
  name_override = "pezm_three_phase_sensor"
  data_format = "json_v2"

  [[inputs.mqtt_consumer.json_v2]]
    [[inputs.mqtt_consumer.json_v2.object]]
      path = "ENERGY"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Total.0"
        rename = "Total_0"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Total.1"
        rename = "Total_1"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Total.2"
        rename = "Total_2"
        type = "float"
      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Yesterday.0"
        rename = "Yesterday_0"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Yesterday.1"
        rename = "Yesterday_1"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Yesterday.2"
        rename = "Yesterday_2"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Today.0"
        rename = "Today_0"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Today.1"
        rename = "Today_1"
        type = "float"

      [[inputs.mqtt_consumer.json_v2.object.field]]
        path = "Today.2"
        rename = "Today_2"
        type = "float"

Expected results

pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Today_1=2.351,Today_2=0.905,Yesterday_0=5.522,Yesterday_1=3.875,Yesterday_2=2.783,Total_0=212.957,Total_1=293.524 Total_2=473.239 1719340878361661835

Actual results

pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_0=5.522,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_0=5.522,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_0=5.522,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_1=3.875,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_1=3.875,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_1=3.875,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_2=2.783,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_2=2.783,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_0=1.169,Yesterday_2=2.783,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_0=5.522,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_0=5.522,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_0=5.522,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_1=3.875,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_1=3.875,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_1=3.875,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_2=2.783,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_2=2.783,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_1=2.351,Yesterday_2=2.783,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_0=5.522,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_0=5.522,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_0=5.522,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_1=3.875,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_1=3.875,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_1=3.875,Total_2=473.239 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_2=2.783,Total_0=212.957 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_2=2.783,Total_1=293.524 1719340878361661835
pezm_three_phase_sensor,host=CN-D12-Telegraf,topic=tele/pezm_584143/SENSOR Today_2=0.905,Yesterday_2=2.783,Total_2=473.239 1719340878361661835
data_format = "xpath_json"
xpath_native_types = true

[[inputs.file.xpath]]
  metric_name = "'pezm_three_phase_sensor'"
  field_selection = "/ENERGY/*/descendant::*"
  timestamp = "/Time"
  timestamp_format = "2006-01-02T15:04:05"

Produces the following:

pezm_three_phase_sensor ApparentPower_2=680,ReactivePower_0=49,ReactivePower_1=221,Today_0=0.698,Factor_0=0.52,Current_2=3.021,Frequency_0=50,Frequency_2=50,Power_1=242,Yesterday_1=12.554,Voltage_0=225,ApparentPower_0=57,Current_0=0.255,Period_0=0,Period_2=2,Today_1=4.113,Total_1=291.411,Total_2=473.815,Yesterday_2=16.117,Factor_1=0.74,Factor_2=0.97,ReactivePower_2=162,Today_2=4.264,Total_0=206.965,Voltage_1=225,Yesterday_0=6.641,ApparentPower_1=328,Current_1=1.453,Period_1=0,Power_0=30,Voltage_2=225,Frequency_1=50,Power_2=661 1719296403000000000