# Logstash filter pipeline Dynamic if on fields

**URL:** <https://discuss.elastic.co/t/logstash-filter-pipeline-dynamic-if-on-fields/237581>\
**Category:** Logstash\
**Created:** [June 18, 2020, 7:32am UTC](https://discuss.elastic.co/t/logstash-filter-pipeline-dynamic-if-on-fields/237581 "2020-06-18T07:32:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaclav1](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaclav1](https://discuss.elastic.co/u/vaclav1)\
**Post date:** [June 18, 2020, 7:32am UTC](https://discuss.elastic.co/t/logstash-filter-pipeline-dynamic-if-on-fields/237581/1 "2020-06-18T07:32:23Z")

</div>

Hello,

is there any way how to match any field while constructing if in filter pipeline, for example:  
Tried but it seems it matches half of the fields, and half it does not..

```auto
    if [coad][queueStatus][queueByTypes][*][status]{
    // do something
    }

```

Or:

```auto
 if [coad][queueStatus][queueByTypes][*][response][*][connectedTypes]{
    // do something
    }

```

---

<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:** [June 18, 2020, 3:15pm UTC](https://discuss.elastic.co/t/logstash-filter-pipeline-dynamic-if-on-fields/237581/2 "2020-06-18T15:15:28Z")

</div>

An if statement does not support wildcards. You would need to use a ruby filter and iterate over the items in the array or hash.

---

<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 16, 2020, 3:15pm UTC](https://discuss.elastic.co/t/logstash-filter-pipeline-dynamic-if-on-fields/237581/3 "2020-07-16T15:15:37Z")

</div>

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