Rename processor not working with pivot

Hi,

I’m running Telegraf version: 1.33-alpine in a Docker container environment. I’m reading data from a Kafka topic and for two sensors (memory, routingEngine) I need to do a pivot because I receive data like this:

{
    "fields": {
        "property_value": "1234ABCD"
    },
    "name": "routingEngine",
    "tags": {
        "device": "device01.mgt.net",
        "host": "qa-qfx6-gnmi-deployment-664746d779-l6qwr-telegraf-agent",
        "property_name": "fru-model-number",
        "routing_engine": "Routing Engine0"
    },
    "timestamp": 1739471421
}

And I want it to look like:

{
    "fields": {
        "fru-model-number": "1234ABCD"
    },
    "name": "routingEngine",
    "tags": {
        "device": "device01.mgt.net",
        "host": "qa-qfx6-gnmi-deployment-664746d779-l6qwr-telegraf-agent",
        "routing_engine": "Routing Engine0"
    },
    "timestamp": 1739471421
}

The pivot is working, however, the rename is not. I want to rename fru-model-number to fru_model_number, basically just replacing the hyphens with underscores.

I’ve attached my Telegraf Conf file.
telegraf_conf_rename_not_working.txt (9.7 KB)

Thank you,
Mohsin