# Regular expression on array/list field

**URL:** <https://discuss.elastic.co/t/regular-expression-on-array-list-field/149329>\
**Category:** Logstash\
**Created:** [September 20, 2018, 4:47pm UTC](https://discuss.elastic.co/t/regular-expression-on-array-list-field/149329 "2018-09-20T16:47:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jprat](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@jprat](https://discuss.elastic.co/u/jprat)\
**Post date:** [September 20, 2018, 4:47pm UTC](https://discuss.elastic.co/t/regular-expression-on-array-list-field/149329/1 "2018-09-20T16:47:57Z")

</div>

Hi,

I was wondering if it is possible to make an expression into an if condition where I could check if a field, which is an array/list, could contain any string matching certain regular expression. For example

tags =\> ['unparsed\_err1', 'unparsed\_err2']

then I would like to code:

```
if 'unparsed_*' in [tags] {
    do something
}
```

---

<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:** [September 24, 2018, 6:21pm UTC](https://discuss.elastic.co/t/regular-expression-on-array-list-field/149329/2 "2018-09-24T18:21:17Z")

</div>

This isn't possible out of the box. You'll have to use a ruby filter.

---

<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:** [October 22, 2018, 6:21pm UTC](https://discuss.elastic.co/t/regular-expression-on-array-list-field/149329/3 "2018-10-22T18:21:25Z")

</div>

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