Skip to content

'Set Security User' processor overwrites target field #51428

Closed
@peterpramb

Description

@peterpramb

Elasticsearch version:
Version: 7.5.1, Build: default/tar/3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96/2019-12-16T22:57:37.835892Z, JVM: 11.0.5

JVM version:
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

OS version:
Linux 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 16 14:19:51 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
The set_security_user processor simply overwrites an already existing target field provided in field instead of merging it with existing data and only overwriting the fields specified in properties.

I'm not sure if this is a bug or works as intended, but at least the documentation should then make clear that an existing field's data is lost when using this processor.

Steps to reproduce:

  1. Simulate pipeline
POST /_ingest/pipeline/_simulate?verbose=true
{
  "docs": [
    {
      "_index": "gh-51428",
      "_source": {
        "user" : {
          "id": "123",
          "name": "testuser",
          "email": "test@user"
        }
      }
    }
  ],
  "pipeline": {
    "processors": [
      {
        "set_security_user": {
          "field": "user",
          "properties": [
            "username"
          ]
        }
      }
    ]
  }
}
  1. Result
{
  "docs" : [
    {
      "processor_results" : [
        {
          "doc" : {
            "_index" : "gh-51428",
            "_type" : "_doc",
            "_id" : "_id",
            "_source" : {
              "user" : {
                "username" : "someuser"
              }
            },
            "_ingest" : {
              "timestamp" : "2020-01-24T15:55:40.964116Z"
            }
          }
        }
      ]
    }
  ]
}

Metadata

Metadata

Assignees

Labels

:Data Management/Ingest NodeExecution or management of Ingest Pipelines including GeoIP

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions