I am trying to create a chained input for watcher that involves reading response from an API and making another another API call to the service mentioned in the body of the first request. Here's what the input looks like:
"inputs": [
{
"first": {
"http": {
"request": {
"host": "localhost",
"port": 1200,
"path": "/status/service/myservice",
"params": {
"somevar": "somevalue"
}
}
}
}
},
{
"second": {
"http": {
"request": {
"url": "http://{{ctx.payload.first.data[0].ip}}:{{ctx.payload.first.data.port}}/somepath/inservice/status"
}
}
}
}
But when trying to create the watch, I get the error:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "Malformed URL ["http://{{ctx.payload.first.data[0].ip}}:{{ctx.payload.first.data.port}}/somepath/inservice/status]"
}
],
"type": "parse_exception",
"reason": "could not parse [http] input for watch [second]. failed to parse http request template",
"caused_by": {
"type": "parse_exception",
"reason": "Malformed URL ["http://{{ctx.payload.first.data[0].ip}}:{{ctx.payload.first.data.port}}/somepath/inservice/status]"
}
},
"status": 400
}
Also, I see that String values are not allowed in the request.port
and hence the long format for definition of the http request will also not work.
Is this not supported in X-Pack Alerting even in the latest versions? Or I have to upgrade?
Elasticsearch Version: 5.4.2