Hi team,
I am trying to build a watcher that calls an external web service to build the query and then fire an action.
"input": {
"http": {
"request": {
"scheme": "https",
"host": "myhost",
"port": 443,
"method": "get",
"path": "/es",
"params": {},
"headers": {}
}
}
},
The problem is that I don't understand from the docs what the response looks like. I'd like to send a query so that it gets executed on Elastic search, but I don't know what response the HTTP input is expecting.
This is the response I am trying at the moment, but it does not seem to work as it does not return any results, and there are results. I've replaced my query and my script with ${myquery} and ${myscript}
request: {
indices: ['logstash-*'],
rest_total_hits_as_int: true,
body: {
size: 0,
query: {
query_string: {
query:
${myquery}
},
},
aggs: {
account_to_number: {
terms: {
script:
${myscript}
min_doc_count: 100,
size: 500,
},
},
},
},
},
});
Am I missing anything?
Thanks in advance