# Ingest pipeline set processor override property

**URL:** <https://discuss.elastic.co/t/ingest-pipeline-set-processor-override-property/235034>\
**Category:** Elasticsearch\
**Created:** [May 30, 2020, 8:14pm UTC](https://discuss.elastic.co/t/ingest-pipeline-set-processor-override-property/235034 "2020-05-30T20:14:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dumitrel\_Ciprian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dumitrel_ciprian/32/46548_2.png) [@Dumitrel\_Ciprian](https://discuss.elastic.co/u/Dumitrel_Ciprian)\
**Post date:** [May 30, 2020, 8:14pm UTC](https://discuss.elastic.co/t/ingest-pipeline-set-processor-override-property/235034/1 "2020-05-30T20:14:29Z")

</div>

Hi,

I have difficulties in using the "override" option of the SET processor. The use case is the following:

1. I'm creating a document like this:

2. Sometimes I have cases when an update for an existing document comes with a value of **null** for field "foo" or "bar", like:

What I want is: if field foo or bar is null and for the existing document there's already a non-null value for the same field, do not override the value by setting it to null. According to [https://www.elastic.co/guide/en/elasticsearch/reference/current/set-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/set-processor.html), the override field has the default value true and its description is:

_If processor will update fields with pre-existing non-null-valued field. When set to `false` , such fields will not be touched._

This is exactly what I want. I created the pipeline like this:

```
PUT _ingest/pipeline/preventNullValuesOverriding
{
  "description" : "ignore null values for foo and bar",
  "processors" : [
    {
      "set" : {
        "field": "foo",
        "value": "default",
        "override": false
      }
    },
    {
      "set" : {
        "field": "bar",
        "value": "default",
        "override": false
      }
    }
  ]
}

```

I've put the value of "default" because I'm forced to do put a value. I then attached the processor to the **test\_index** index.

But then if I modify an existing document by setting foo or bar to null, the merge result will be "default" for that field.

Can somebody point me to how I can achieve my desired behaviour?

thanks a lot!

---

<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:** [June 27, 2020, 8:14pm UTC](https://discuss.elastic.co/t/ingest-pipeline-set-processor-override-property/235034/2 "2020-06-27T20:14:32Z")

</div>

Closed on June 27, 2020, 8:14pm UTC

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