# How to set filter to check for multiple conditions?

**URL:** https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491
**Category:** Kibana
**Created:** [November 14, 2017, 5:52am UTC](https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491 "2017-11-14T05:52:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Aswin\_Francis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswin_francis/32/24173_2.png) [@Aswin\_Francis](https://discuss.elastic.co/u/Aswin_Francis)
#### Post date: [November 14, 2017, 5:52am UTC](https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491/1 "2017-11-14T05:52:31Z")

</div>

I want to add a filter to my existing saved search where I want hide message based on source\_name and event\_id. So basically if source\_name=Microsoft-Windows-Perflib and event\_id=1008 then it should display on the discover page.  
{  
"query": {  
"match": {  
"source\_name": {  
"query": "Microsoft-Windows-Perflib",  
"type": "phrase"  
}  
}  
}  
}

The above filter i added just uses the source name. Can some one help me add filter based on two conditions? I am not given a lot of time to sort few things and i might add more questions as i work in this

---

<div class="post-metadata">

### Author: ![amolagnihotri](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@amolagnihotri](https://discuss.elastic.co/u/amolagnihotri)
#### Post date: [November 14, 2017, 7:00am UTC](https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491/2 "2017-11-14T07:00:23Z")

</div>

You can try this ...

{  
"query": {  
"bool": {  
"should": [  
{"match": {"source\_name": {"query": "Microsoft-Windows-Perflib", "type": "phrase"} } },  
{"match": {"source\_name": {"query": "event\_id=1008", "type": "phrase"} } }  
]}  
}  
}

---

<div class="post-metadata">

### Author: ![Aswin\_Francis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswin_francis/32/24173_2.png) [@Aswin\_Francis](https://discuss.elastic.co/u/Aswin_Francis)
#### Post date: [November 14, 2017, 7:07am UTC](https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491/3 "2017-11-14T07:07:40Z")

</div>

Thank you so much!!! 🙂 Does Kibana have a list of generic windows error that can be ignored instead of manually creating filter?

---

<div class="post-metadata">

### Author: ![Aswin\_Francis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswin_francis/32/24173_2.png) [@Aswin\_Francis](https://discuss.elastic.co/u/Aswin_Francis)
#### Post date: [November 14, 2017, 12:34pm UTC](https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491/4 "2017-11-14T12:34:19Z")

</div>

Andi think you meant:  
{  
"query": {  
"bool": {  
"should": [  
{"match": {"source\_name": {"query": "Microsoft-Windows-Perflib", "type": "phrase"} } },  
{"match": {"event\_id": {"query": "1008", "type": "phrase"} } }  
]}  
}  
}

---

<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: [December 12, 2017, 12:34pm UTC](https://discuss.elastic.co/t/how-to-set-filter-to-check-for-multiple-conditions/107491/5 "2017-12-12T12:34:20Z")

</div>

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