# If condition Statement

**URL:** <https://discuss.elastic.co/t/if-condition-statement/262167>\
**Category:** Logstash\
**Created:** [January 25, 2021, 8:38pm UTC](https://discuss.elastic.co/t/if-condition-statement/262167 "2021-01-25T20:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzarrabi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hzarrabi](https://discuss.elastic.co/u/hzarrabi)\
**Post date:** [January 25, 2021, 8:38pm UTC](https://discuss.elastic.co/t/if-condition-statement/262167/1 "2021-01-25T20:38:04Z")

</div>

Hi All,

Could you please tell me what is wrong with the following IF condition

```
if [DOCUMENT_MODEL] == "10000" {
      mutate { 
         replace => { "DOCUMENT_MODEL" => "INVOICE" }
      } 
}

```

Even though the DOCUMENT\_MODEL is equal to 10000, it doesn't go to the replace.

Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 25, 2021, 11:17pm UTC](https://discuss.elastic.co/t/if-condition-statement/262167/2 "2021-01-25T23:17:03Z")

</div>

If DOCUMENT\_MODEL is an integer then that would have to be

```
if [DOCUMENT_MODEL] == 10000 {

```

Note also that I removed the spaces inside the (if your field names really contain spaces then obviously you will need the spaces).

---

<div class="post-metadata">

**Author:** ![hzarrabi](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hzarrabi](https://discuss.elastic.co/u/hzarrabi)\
**Post date:** [January 26, 2021, 2:53am UTC](https://discuss.elastic.co/t/if-condition-statement/262167/3 "2021-01-26T02:53:35Z")

</div>

Hi @Badger,  
Thank you so much.  
Indeed the problem was spaces.  
Regars

---

<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 23, 2021, 2:53am UTC](https://discuss.elastic.co/t/if-condition-statement/262167/4 "2021-02-23T02:53:38Z")

</div>

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