Is watchers query fields similar to elasticsearch or is it different

alerting

(Bharath Karnam) #1

I'm using watcher, the reason I ask this is because both are different APIs but the field looks pretty much similar
GET /_search
{
"query": {
"bool": {
"should": [
{ "match": { "title": "War and Peace" }},
{ "match": { "author": "Leo Tolstoy" }}
]
}
}
}

Watcher
input" : {
"search" : {
"request" : {
"indices" : [ "logs" ],
"types" : [ "event" ],
"body" : {
"query" : { "match_all" : {}}
}
}
}
}
My question is if I pass the query similar to elasticsearch using watcher API is it correct or it will not work?


(Alexander Reelsen) #2

Hey,

you can just pass the query inside of the body object and it will work. See the search input documentation

--Alex


(system) #3