# Ingest Pipeline: drop processor: compile error

**URL:** <https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548>\
**Category:** Kibana\
**Tags:** ingest-pipeline\
**Created:** [January 28, 2021, 7:09pm UTC](https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548 "2021-01-28T19:09:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asc-adean](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asc-adean/32/83073_2.png) [@asc-adean](https://discuss.elastic.co/u/asc-adean)\
**Post date:** [January 28, 2021, 7:09pm UTC](https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548/1 "2021-01-28T19:09:28Z")

</div>

As documented here  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/drop-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/drop-processor.html)

I want to be able to drop a document when matching on a field, like so

```auto
    {
      "processors": [
    {
      "json": {
        "field": "message",
        "add_to_root": true,
        "ignore_failure": true
      }
    },
    {
      "drop": {
        "if": "req.url == '/api/v1/health'",
        "ignore_failure": true
      }
    }
      ]
    }

```

But I am getting a compile error in the ingest ui. The browser dev tool inspector gives me this reason why:

400 Bad Request

type: illegal\_argument\_exception  
reason: cannot resolve symbol [req.url]

I can provide additional screenshots if needed.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [January 28, 2021, 7:35pm UTC](https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548/2 "2021-01-28T19:35:17Z")

</div>

Can you share an example document?

If the field is called `req.url`, I think it has to be referenced by `ctx.req.url` in the condition.

---

<div class="post-metadata">

**Author:** ![asc-adean](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asc-adean/32/83073_2.png) [@asc-adean](https://discuss.elastic.co/u/asc-adean)\
**Post date:** [January 28, 2021, 7:42pm UTC](https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548/3 "2021-01-28T19:42:18Z")

</div>

Hi,

Thanks for that tip, it did accept the ctx. prefix to the field, I'll check on how it works. Appreciate it

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [January 28, 2021, 7:45pm UTC](https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548/4 "2021-01-28T19:45:42Z")

</div>

Think of the `if` as a mini script - "ctx" is the variable containing the current document. `ctx.req.url` is looking up the value for the object.

It's similar to this: [https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-ingest-processor-context.html](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-ingest-processor-context.html)

---

<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:** [February 25, 2021, 7:46pm UTC](https://discuss.elastic.co/t/ingest-pipeline-drop-processor-compile-error/262548/5 "2021-02-25T19:46:05Z")

</div>

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