# Drop ingest pipeline for one host

**URL:** <https://discuss.elastic.co/t/drop-ingest-pipeline-for-one-host/308555>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [June 30, 2022, 10:04am UTC](https://discuss.elastic.co/t/drop-ingest-pipeline-for-one-host/308555 "2022-06-30T10:04:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atul\_Chadha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_chadha/32/75469_2.png) [@Atul\_Chadha](https://discuss.elastic.co/u/Atul_Chadha)\
**Post date:** [June 30, 2022, 10:04am UTC](https://discuss.elastic.co/t/drop-ingest-pipeline-for-one-host/308555/1 "2022-06-30T10:04:40Z")

</div>

I am running 7.17 ELS and trying to drop all docs which come from one specific host

```auto
		"drop": {
          "if" : ("agent.name" == 'ABC')
        },

```

I have added this as drop processor in ingest pipeline however it keeps on complaing about comple error and wont allow me to save it.

Any idea what may be wrong, i have gone thru internet for similar error however dont seem to find the root cause.

Ref: [Elasticsearch ingest pipeline drop processor no worky :(](https://discuss.elastic.co/t/elasticsearch-ingest-pipeline-drop-processor-no-worky/198904)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 30, 2022, 1:37pm UTC](https://discuss.elastic.co/t/drop-ingest-pipeline-for-one-host/308555/2 "2022-06-30T13:37:22Z")

</div>

Hi @Atul_Chadha

Did you look at the docs [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/drop-processor.html) you have bad syntax Note the outer double quotes and the inner single quotes. Also you need to use the context `ctx` You should also read about null type safety and conditionals [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/drop-processor.html)

There's an excellent example, much like yours.

```auto
PUT _ingest/pipeline/my-pipeline
{
  "processors": [
    {
      "drop": {
        "description": "Drop documents with 'network.name' of 'Guest'",
        "if": "ctx?.network?.name == 'Guest'"
      }
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![Atul\_Chadha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_chadha/32/75469_2.png) [@Atul\_Chadha](https://discuss.elastic.co/u/Atul_Chadha)\
**Post date:** [July 1, 2022, 2:21am UTC](https://discuss.elastic.co/t/drop-ingest-pipeline-for-one-host/308555/3 "2022-07-01T02:21:41Z")

</div>

Thank you! It was indeed syntax error.

---

<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:** [July 29, 2022, 2:22am UTC](https://discuss.elastic.co/t/drop-ingest-pipeline-for-one-host/308555/4 "2022-07-29T02:22:17Z")

</div>

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