Painless error

Question is easy (and yes I am new to this painfull stuff), what am I doing wrong?

{
  "docs": [
    {
      "error": {
        "root_cause": [
          {
            "type": "script_exception",
            "reason": "runtime error",
            "script_stack": [
              "ctx['additional-data'].value.contains('qs:')",
              "                      ^---- HERE"
            ],
            "script": "ctx['additional-data'].value.contains('qs:')",
            "lang": "painless",
            "position": {
              "offset": 22,
              "start": 0,
              "end": 44
            }
          }
        ],
        "type": "script_exception",
        "reason": "runtime error",
        "script_stack": [
          "ctx['additional-data'].value.contains('qs:')",
          "                      ^---- HERE"
        ],
        "script": "ctx['additional-data'].value.contains('qs:')",
        "lang": "painless",
        "position": {
          "offset": 22,
          "start": 0,
          "end": 44
        },
        "caused_by": {
          "type": "illegal_argument_exception",
          "reason": "dynamic getter [java.lang.String, value] not found"
        }
      }
    }
  ]
}

Better said, what is the RIGHT way to do this? I am creating a pipeline with a processor with a conditional

The concerning part of the pipeline:

      {
        "dissect" : {
          "field" : "additional-data",
          "pattern" : "RC: %{ms-result} | executionTime(ms): %{execution-time}",
          "if" : "ctx['additional-data'].value.contains('qs:')"
        }
      }

Thnx

The .value notation only applies to doc values, try just ctx['additional-data'] within the context of an ingest pipeline (compared to the context of a script filter for example or a scripted aggregation).

1 Like

Thanks for your quick reply. I don't know if it works now because I bump into another issue, but the error I bumped onto is gone, so I will mark your reply as solution.

  • Deleted

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.