Skip to content

The set processor introduces unwanted escape characters (backslashes) when using templated fields #65115

@mbrunnert

Description

@mbrunnert

Elasticsearch version (bin/elasticsearch --version):

7.9.3 on Elastic cloud

Plugins installed: []

JVM version (java -version):

OS version (uname -a if on a Unix-like system):

Description of the problem including expected versus actual behavior:

The set processor introduces unwanted escape characters (backslashes) when using templated fields. The behaviour has been observed for double quotes (")

Steps to reproduce:

Input:

POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {
        "set": {
          "field": "message2",
          "value": "{{message}}"
        }
      }
    ]
  },
  "docs": [
    {
      "_source" : {
      "message" : """10.10.1.1 - - [17/Nov/2020:04:59:43 +0000] "GET /info HTTP/1.1" 200 6229 "-" "-"  2"""
      }
    }
    ]
}

Output:

{
  "docs" : [
    {
      "doc" : {
        "_index" : "_index",
        "_type" : "_doc",
        "_id" : "_id",
        "_source" : {
          "message" : """10.10.1.1 - - [17/Nov/2020:04:59:43 +0000] "GET /info HTTP/1.1" 200 6229 "-" "-"  2""",
          "message2" : """10.10.1.1 - - [17/Nov/2020:04:59:43 +0000] \"GET /info HTTP/1.1\" 200 6229 \"-\" \"-\"  2"""
        },
        "_ingest" : {
          "timestamp" : "2020-11-17T05:26:12.174346581Z"
        }
      }
    }
  ]
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions