# Dynamic fields value matching

**URL:** <https://discuss.elastic.co/t/dynamic-fields-value-matching/143490>\
**Category:** Logstash\
**Created:** [August 8, 2018, 10:39am UTC](https://discuss.elastic.co/t/dynamic-fields-value-matching/143490 "2018-08-08T10:39:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghuveer\_SJ](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@Raghuveer\_SJ](https://discuss.elastic.co/u/Raghuveer_SJ)\
**Post date:** [August 8, 2018, 10:39am UTC](https://discuss.elastic.co/t/dynamic-fields-value-matching/143490/1 "2018-08-08T10:39:08Z")

</div>

I want to perform a matching like :

```
if [type] in ["*UI"] { 
#do something
}

```

I know its not going to work. I want to do a regrex matching. But is there a way ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 8, 2018, 12:14pm UTC](https://discuss.elastic.co/t/dynamic-fields-value-matching/143490/2 "2018-08-08T12:14:20Z")

</div>

If you want to check if `type` ends with "UI" this'll work:

```
if [type] =~ /UI$/ {

```

See [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals).

---

<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:** [September 5, 2018, 12:14pm UTC](https://discuss.elastic.co/t/dynamic-fields-value-matching/143490/3 "2018-09-05T12:14:26Z")

</div>

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