Skip to content

[Feature Request] Rename ingest processor supports overriding target field if exists #12942

@gaobinlong

Description

@gaobinlong

Is your feature request related to a problem? Please describe

The rename ingest processor always throws error when the target field exists in the document, which is not friendly:

POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {
        "rename": {
          "field": "a",
          "target_field": "b"
        }
      }
    ]
  },
  "docs": [
    {
      "_source": {
        "a":1,
        "b":2
      }
    }
  ]
}

, response:

{
  "docs": [
    {
      "error": {
        "root_cause": [
          {
            "type": "illegal_argument_exception",
            "reason": "field [b] already exists"
          }
        ],
        "type": "illegal_argument_exception",
        "reason": "field [b] already exists"
      }
    }
  ]
}

. Just like the Hard_rename rule in the Modify filter plugin of fluent-bit, the rename ingest processor can support something like override_target, which can be used to override the target field if it does exist.

Describe the solution you'd like

Rename ingest processor supports overriding target field if exists.

Related component

Indexing

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    IndexingIndexing, Bulk Indexing and anything related to indexingenhancementEnhancement or improvement to existing feature or requestv2.14.0v3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    Status

    Planned work items

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions