All Products
Search
Document Center

Simple Log Service:Extension plugin: Rename fields

Last Updated:Aug 22, 2025

You can use the processor_rename plugin to rename fields when you collect logs with Logtail. This topic describes the parameters and provides configuration examples for the processor_rename plugin.

Limits

Text logs and container standard output support only form-based configuration. Other input plugins support only JSON configuration.

Entry point

To use a Logtail plugin to process logs, you can add a plugin configuration when you create or modify a Logtail collection configuration. For more information, see Overview of Logtail plugins for data processing.

Configuration description

Important

The processor_rename plugin is supported in Logtail 0.16.28 and later.

Form-based configuration

  • Parameters

    Set Processor Type to Rename Fields. The following table describes the parameters.

    Parameter

    Description

    Source Field

    The source field to rename.

    Result Field

    The name of the field after it is renamed.

    Report Error For Missing Source Field

    Select this option to report an error if the specified source field does not exist in the log.

  • Example

    The following example shows how to rename the aaa1 field to bbb1 and the aaa2 field to bbb2.

    • Raw log

      "aaa1":"value1"
      "aaa2":"value2"
      "aaa3":"value3"
    • Logtail plugin configuration 重命名字段

    • Result

      "bbb1":"value1"
      "bbb2":"value2"
      "aaa3":"value3"

JSON configuration

  • Parameters

    Set type to processor_rename. The following table describes the parameters in detail.

    Parameter

    Type

    Required

    Description

    NoKeyError

    Boolean

    No

    Specifies whether to report an error if the specified source field does not exist in the log.

    • true: An error is reported.

    • false (default): No error is reported.

    SourceKeys

    String array

    Yes

    The source fields to rename.

    DestKeys

    String array

    Yes

    The result fields.

  • Example

    The following example shows how to rename the aaa1 field to bbb1 and the aaa2 field to bbb2.

    • Raw log

      "aaa1":"value1"
      "aaa2":"value2"
      "aaa3":"value3"
    • Logtail plugin configuration

      {
        "processors":[
          {
            "type":"processor_rename",
            "detail": {
              "SourceKeys": ["aaa1","aaa2"],
              "DestKeys": ["bbb1","bbb2"],
              "NoKeyError": true
            }
          }
        ]
      }
    • Result

      "bbb1":"value1"
      "bbb2":"value2"
      "aaa3":"value3"

References