I have a multiple watches that perform a webhook action. I want to store the host in a ctx.metatdata field for flexibility in cases where the host may differ depending on installation parameters, but the {{ctx.metadata}} value isn't being translated on watch execution.
meta data look like this:
"metadata":
{
"Host" : "myurl",
"Authorization" : "myauth"
}
webhook like this:
"webhook" :
{
"method" : "post",
"scheme" : "https",
"host" : "{{ctx.metadata.Host}}",
"headers" :
{
"Authorization": "Basic {{ctx.metadata.Authorization}}",
},
}
when the watch is executed I get this error
"reason": "ElasticsearchException[Illegal character in authority at index 8: https://{{ctx.metadata.Host}}:443/rest/api/2/issue]; nested: URISyntaxException[Illegal character in authority at index 8: https://{{ctx.metadata.Host}}:443/rest/api/2/issue]; "
When host is hard coded everything works. The ctx.metadata.Authorization translation in the "headers" section occurs as expected so I can only assume the webhook.host field doesn't support ctx.metadata values. Can anyone confirm, or provide an alternative.
I'm using Elasticsearch version 2.1.2