Unknown_host_exception | watcher webhook

Hi Team,

I'm a newbie and I'm trying to create a watcher. I'm receiving this error and I don't know what I'm doing wrong.

 "actions": [
      {
        "id": "my_webhook",
        "type": "webhook",
        "status": "failure",
        "error": {
          "root_cause": [
            {
              "type": "unknown_host_exception",
              "reason": "https"
            }
          ],
          "type": "unknown_host_exception",
          "reason": "https"
        }
      }
    ]
  },
  "messages": []
}

My actions is:

    "my_webhook": {
      "webhook": {
        "scheme": "https",
        "host": "https://chat.googleapis.com/",
        "port": 9200,
        "method": "post",
        "path": "https://chat.googleapis.com/v1/spaces/X/messages?key=X&token=X",
        "params": {},
        "headers": {},
        "body": "count: {{ctx.payload.hits.total}}"
      }
    }
  }

Please, could you help me? Thanks a lot!

Could you try this

    "my_webhook": {
      "webhook": {
        "scheme": "https",
        "host": "chat.googleapis.com",
        "port": 9200,
        "method": "post",
        "path": "/v1/spaces/X/messages?key=X&token=X",
        "params": {},
        "headers": {},
        "body": "count: {{ctx.payload.hits.total}}"
      }
    }
  }```

Thank you so much for your answer!
Unfortunately, I'm getting this now:

"actions": [
      {
        "id": "my_webhook",
        "type": "webhook",
        "status": "failure",
        "error": {
          "root_cause": [
            {
              "type": "unknown_host_exception",
              "reason": "https: Name or service not known"
            }
          ],
          "type": "unknown_host_exception",
          "reason": "https: Name or service not known"
        }
      }
    ]
  },
  "messages": []
}

This means, that somehow the system the watch is being executed on, cannot resolve chat.googleapis.com via its DNS configuration. Could you verify that?

I don't know how to do that or even if I have access to doing that. Anyways, thank you so much for all the help!

From the server where Elasticsearch is running, try to ping that domain or an nslookup to check

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