# Or check in filter plugin

**URL:** <https://discuss.elastic.co/t/or-check-in-filter-plugin/139979>\
**Category:** Logstash\
**Created:** [July 13, 2018, 4:28pm UTC](https://discuss.elastic.co/t/or-check-in-filter-plugin/139979 "2018-07-13T16:28:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honda\_fred\_elk](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@Honda\_fred\_elk](https://discuss.elastic.co/u/Honda_fred_elk)\
**Post date:** [July 13, 2018, 4:28pm UTC](https://discuss.elastic.co/t/or-check-in-filter-plugin/139979/1 "2018-07-13T16:28:42Z")

</div>

Hello,

I have logstash configuration to get two types of inputs, one from File another from Beats.  
So I'm setting type variable as "file\_input" and "beats\_input" respectively.

Next In the filter plugin, I have to have a if condition like below

```
if "file_input" in [type]{
  .....
} 

```

which is working fine.

But in one place have to have a check both the input types..  
So want to know how to have OR check in the if condition?

```
if ["file_input" || "beats_input"] in [type]{
     .......
}

```

Please advise .. Thanks in advance

---

<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:** [July 13, 2018, 4:39pm UTC](https://discuss.elastic.co/t/or-check-in-filter-plugin/139979/2 "2018-07-13T16:39:03Z")

</div>

You could do it using in as a test for array membership

```
if [type] in ["file_input", "beat_input"] 

```

Or you could do it like this

```
if [type] == "file_input" or [type] == "beat_input"
```

---

<div class="post-metadata">

**Author:** ![Honda\_fred\_elk](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@Honda\_fred\_elk](https://discuss.elastic.co/u/Honda_fred_elk)\
**Post date:** [July 13, 2018, 4:39pm UTC](https://discuss.elastic.co/t/or-check-in-filter-plugin/139979/3 "2018-07-13T16:39:57Z")

</div>

Thank you so much Badger..

---

<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:** [August 10, 2018, 4:40pm UTC](https://discuss.elastic.co/t/or-check-in-filter-plugin/139979/4 "2018-08-10T16:40:05Z")

</div>

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