# Issue with ingestion pipeline with conditional

**URL:** <https://discuss.elastic.co/t/issue-with-ingestion-pipeline-with-conditional/325747>\
**Category:** Elasticsearch\
**Tags:** painless, ingest-pipeline, runtime-fields\
**Created:** [February 16, 2023, 1:44pm UTC](https://discuss.elastic.co/t/issue-with-ingestion-pipeline-with-conditional/325747 "2023-02-16T13:44:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubhamra](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rubhamra](https://discuss.elastic.co/u/rubhamra)\
**Post date:** [February 16, 2023, 1:44pm UTC](https://discuss.elastic.co/t/issue-with-ingestion-pipeline-with-conditional/325747/1 "2023-02-16T13:44:51Z")

</div>

Hello, I am trying to parse and compare values through ingest pipeline, but couldn't do it,  
I was running below code, grok is running fine, but couldn't be able to compare value in set condition.

```auto
POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {
        "grok": {
          "field": "message",
          "patterns": ["%{HOSTNAME:host.name},%{WORD:host.driveletter},%{INT:host.driveusage}"]
        },
        "set": {
          "field": "summary.down",
          "value": 1,
          "if": "ctx.host.name == 'CALCWZ88C3'"
        }
      }
    ]
  },
  "docs": [
    {
      "_source": {
        "message": "CALCWZ88C3,C,13"
      }
      
    }
    
  ]
}

```

getting below issues

```auto
{
  "docs": [
    {
      "error": {
        "root_cause": [
          {
            "type": "script_exception",
            "reason": "runtime error",
            "script_stack": [
              "ctx.host.name == 'CALCWZ88C3'",
              " ^---- HERE"
            ],
            "script": "ctx.host.name == 'CALCWZ88C3'",
            "lang": "painless",
            "position": {
              "offset": 8,
              "start": 0,
              "end": 29
            }
          }
        ],
        "type": "script_exception",
        "reason": "runtime error",
        "script_stack": [
          "ctx.host.name == 'CALCWZ88C3'",
          " ^---- HERE"
        ],
        "script": "ctx.host.name == 'CALCWZ88C3'",
        "lang": "painless",
        "position": {
          "offset": 8,
          "start": 0,
          "end": 29
        },
        "caused_by": {
          "type": "null_pointer_exception",
          "reason": "cannot access method/field [name] from a null def reference"
        }
      }
    }
  ]
}

```

Could you please help ?

I have one more question , is there \< and \> than operators in ingest pipeline you can use, if yes please what's the syntax, I have to compare value which comes from grok output

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [February 16, 2023, 9:51pm UTC](https://discuss.elastic.co/t/issue-with-ingestion-pipeline-with-conditional/325747/2 "2023-02-16T21:51:34Z")

</div>

This looks like a possible [duplicate](https://discuss.elastic.co/t/operators-in-ingest-pipeline/325743). Please see that answer.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 16, 2023, 9:51pm UTC](https://discuss.elastic.co/t/issue-with-ingestion-pipeline-with-conditional/325747/3 "2023-03-16T21:51:53Z")

</div>

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