# Two field regex in Kibana

**URL:** https://discuss.elastic.co/t/two-field-regex-in-kibana/100016
**Category:** Kibana
**Created:** [September 11, 2017, 8:17am UTC](https://discuss.elastic.co/t/two-field-regex-in-kibana/100016 "2017-09-11T08:17:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Maekee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maekee/32/21708_2.png) [@Maekee](https://discuss.elastic.co/u/Maekee)
#### Post date: [September 11, 2017, 8:17am UTC](https://discuss.elastic.co/t/two-field-regex-in-kibana/100016/1 "2017-09-11T08:17:05Z")

</div>

Hi,

I would like to create a regex filter that says  
Hide Event\_id 1000 IF field targetusername ends with a dollar sign, otherwise.. show the Event 1000.

I have created regexp filters but cant figure out how to do the next step.  
Is there any other filter that supports wildcards and regex than regexp?

Thanks

---

<div class="post-metadata">

### Author: ![Maekee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maekee/32/21708_2.png) [@Maekee](https://discuss.elastic.co/u/Maekee)
#### Post date: [September 11, 2017, 1:15pm UTC](https://discuss.elastic.co/t/two-field-regex-in-kibana/100016/2 "2017-09-11T13:15:29Z")

</div>

Think i solved it like this, dont know if its the best solution but it seems to work

{  
"query": {  
"bool": {  
"must": {  
"match": {  
"event\_data.SubjectUserName": "Spiderman"  
}  
},  
"filter": {  
"regexp": {  
"event\_data.TargetUserName": {  
"value": ".\*~$"  
}  
}  
}  
}  
}  
}

---

<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 9, 2017, 1:15pm UTC](https://discuss.elastic.co/t/two-field-regex-in-kibana/100016/3 "2017-10-09T13:15:56Z")

</div>

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