# How to match multiple fields to single value with IF

**URL:** <https://discuss.elastic.co/t/how-to-match-multiple-fields-to-single-value-with-if/206844>\
**Category:** Logstash\
**Created:** [November 6, 2019, 5:49pm UTC](https://discuss.elastic.co/t/how-to-match-multiple-fields-to-single-value-with-if/206844 "2019-11-06T17:49:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew22](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew22](https://discuss.elastic.co/u/Andrew22)\
**Post date:** [November 6, 2019, 5:49pm UTC](https://discuss.elastic.co/t/how-to-match-multiple-fields-to-single-value-with-if/206844/1 "2019-11-06T17:49:58Z")

</div>

I am trying to match multiple fields to a single value then mutate the field if necessary in a single if statement instead of having multiple different If statements

For example:

if [1] or [2] or [3] = null {

```
mutate {
             gsub => ['Field(s) That Matched, "null", "0"]
}

```

}

would this be possible?

---

<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:** [December 4, 2019, 5:50pm UTC](https://discuss.elastic.co/t/how-to-match-multiple-fields-to-single-value-with-if/206844/2 "2019-12-04T17:50:02Z")

</div>

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