# How to write two queries in kibana search bar

**URL:** <https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704>\
**Category:** Kibana\
**Created:** [November 27, 2015, 5:20am UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704 "2015-11-27T05:20:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [November 27, 2015, 5:20am UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704/1 "2015-11-27T05:20:44Z")

</div>

Hi Experts,

I have a very basic requirement but I am struggling to achieve it. In Kibana I want to search all the logs where `baseEventIds` filed is `not Null` and `priority` should be "High" OR "VeryHigh".

Individually both the searches are working fine  
To check not null I am using following and it is working fine  
`{"constant_score":{"filter":{"exists":{"field":"baseEventIds"}}}}`  
To check priority I am using following and it is working fine too  
`priority:"High" OR priority:"VeryHigh"`

Kibana is not allowing me to combine both the queries in the search bar.I am trying  
`{"constant_score":{"filter":{"exists":{"field":"baseEventIds"}}}} AND priority:"High" OR priority:"VeryHigh"`

is it because of syntax error ? I almost tried all the options ,Please suggest how i can achieve this ?

---

<div class="post-metadata">

**Author:** ![german23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/german23/32/11052_2.png) [@german23](https://discuss.elastic.co/u/german23)\
**Post date:** [November 27, 2015, 7:09am UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704/2 "2015-11-27T07:09:47Z")

</div>

The quick&dirty solution would be:

baseEventIds:\* AND (priority:High OR priority:VeryHigh)

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [November 27, 2015, 8:10am UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704/3 "2015-11-27T08:10:15Z")

</div>

Wow!! thanks German23 ,yes you are right it was quick and simple , not sure why you called it Dirty .

BTW I tried and it works too

`{"constant_score" : { "filter" : {"bool" : {"should" : [{ "term" : {"priority" : "High"}}, {"term" : {"priority" : "VeryHigh"}}],"must" : {"exists":{"field":"baseEventIds"}}}}}}`

Thanks  
VG

---

<div class="post-metadata">

**Author:** ![SuperPringles](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/superpringles/32/5303_2.png) [@SuperPringles](https://discuss.elastic.co/u/SuperPringles)\
**Post date:** [November 27, 2015, 9:28am UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704/4 "2015-11-27T09:28:32Z")

</div>

It often helps to think of it like SQL queries 🙂

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [November 27, 2015, 9:30am UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704/5 "2015-11-27T09:30:55Z")

</div>

I agreed SuperPringles.

---

<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:** [July 6, 2017, 2:08pm UTC](https://discuss.elastic.co/t/how-to-write-two-queries-in-kibana-search-bar/35704/6 "2017-07-06T14:08:07Z")

</div>


