# Statically match multiple values depending on matchin regex

**URL:** <https://discuss.elastic.co/t/statically-match-multiple-values-depending-on-matchin-regex/320972>\
**Category:** Logstash\
**Created:** [December 11, 2022, 2:12pm UTC](https://discuss.elastic.co/t/statically-match-multiple-values-depending-on-matchin-regex/320972 "2022-12-11T14:12:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pondo\_m](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@pondo\_m](https://discuss.elastic.co/u/pondo_m)\
**Post date:** [December 11, 2022, 2:12pm UTC](https://discuss.elastic.co/t/statically-match-multiple-values-depending-on-matchin-regex/320972/1 "2022-12-11T14:12:50Z")

</div>

I want to set a statically defined value depending on the matching regex.  
Currently Im using the translate filter plugin with a dictionary of 400 entries to set the value depending on the matching regex.  
Is it possible to have multiple matching regex and therefore set multiple values?

Example String:  
"This is a sample string"

Static mapping for regex to value:  
._is._ =\> "is"  
._string._ =\> "string"

Then my result should contain a list of all the values for the matching patterns  
contains = ["is", "string"]

How could this be achieved?  
Any ideas would be highly appreciated 🙂

---

<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:** [January 8, 2023, 2:13pm UTC](https://discuss.elastic.co/t/statically-match-multiple-values-depending-on-matchin-regex/320972/2 "2023-01-08T14:13:05Z")

</div>

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