Error in sending datagram while using UDP handler

I have written udp handler to send the event alerts to the webhook url as below :

{
“handlers”: {
“example_udp_handler”: {
“type”: “udp”,
“timeout”: 60,
“socket”: {
“host”: “https://webhook.site/7ecc7665-10d7-4792-99f8-23e77c1b9b51”,
“bind”: “0.0.0.0”,
“port”: 80
}
}
}
}

In sensu-server.log, I am receiving error as error":“error in sending datagram”.

Please check and help me where iam doing wrong.

Hi @Arun407,

TCP and UDP handlers simply open a connection to a specific port and send the event data through. In your case, it looks like you are trying to use a UDP handler to make an HTTP request which isn’t going to work.

Because HTTP is a higher level protocol which is typically implemented on top of TCP, I believe you’ll need to use a pipe handler which can send event data to your webhook URL.

I’m not aware of an existing webhook handler to share with you as an example, but bear in mind that the Sensu event data probably needs to be changed by a mutator or handler before it can be sent to Webhooks which may expect a specific data format.

Hope this helps!