Watcher parse_exception (actions proxy.host)

Hi elastic community,

I use kibana watcher send alert message to telegram.

error log input search and filter work very well.

But, in actions part, I need to use proxy connect to the external network.

I got information below

Watcher: [parse_exception] could not parse http request template. unexpected string field [proxy.host]

My proxy setting wrong?

Here is my watcher config

"actions": {
"my_webhook": {
"webhook": {
"scheme": "http",
"host": "api.telegram.org",
"port": 443,
"proxy.host": "172.16.99.125",
"proxy.port": "3128",
"method": "post",
"path": "/botmybotid/sendMessage",
"params": {
"text": "There are {{ctx.payload.hits.total}} error logs occurred 30 minutes ago",
"chat_id": "-mychatid"
},
"headers": {}
}
}
}
}

Hi, it looks like you meant to post this question in the Elasticsearch topic, because Watcher is a feature of X-Pack in Elasticsearch. Kibana has a UI for crafting Watches, but the functionality remains in ES.

Hope that helps,
-Tim

try to remove the double quote

hi, now remove the double quote

"actions": {
"my_webhook": {
"webhook": {
"scheme": "https",
"host": "api.telegram.org",
"port": 443,
"proxy.host": "172.16.99.125",
"proxy.port": 3128,
"method": "post",
"path": "/botmybotid/sendMessage",
"params": {
"text": "There are {{ctx.payload.hits.total}} error logs occurred 30 minutes ago",
"chat_id": "mychatid"
},
"headers": {}
}
}
}

I still got information

Watcher: [parse_exception] could not parse http request template. unexpected string field [proxy.host]

Remove double quote from proxy.host as well.

hi, Izek

I remove double quote from proxy.host , then I got Invalid JSON error.

Here is my latest config, it is works!!

"actions": {
"my_webhook": {
  "webhook": {
    "scheme": "https",
    "host": "api.telegram.org",
    "port": 443,
    "method": "get",
    "path": "/bot**********:***********/sendMessage",
    "params": {
      "text": "There are {{ctx.payload.hits.total}} error logs occurred 30 minutes ago ",
      "chat_id": "-*********"
    },
    "headers": {},
    "proxy": {
      "host": "172.16.99.125",
      "port": 3128
    }
  }
}

}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.