How to write two queries in kibana search bar

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 ?

The quick&dirty solution would be:

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

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

It often helps to think of it like SQL queries :slight_smile:

I agreed SuperPringles.