Webhook¶
Out of the box the Webhook Collector is available on the NetEye Master and, if present, on Satellites, and the webhooks are to be configured.
On startup, it creates a dedicated REST endpoint for each configured webhook. Calls received by an endpoint are processed by the embedded JMESPath Collector that uses them to produce Tornado Events. In the final step, the Events are forwarded to the Tornado Engine through the configured connection type.
Webhooks in Tornado Webhook Collector are defined by JSON files, which
are stored in the folder /neteye/shared/tornado_webhook_collector/conf/webhooks/
.
For each webhook, you must provide the following values in order to successfully create an endpoint:
id: The webhook identifier. This will determine the path of the endpoint; it must be unique per webhook.
token: A security token that the webhook issuer has to include in the URL as part of the query string (see the example at the bottom of this page for details). If the token provided by the issuer is missing or does not match the one owned by the Collector, then the call will be rejected and an HTTP 401 code (UNAUTHORIZED) will be returned.
collector_config: The transformation logic that converts a webhook JSON object into a Tornado Event. It consists of a JMESPath Collector configuration.
event_type: A mandatory field to define the event type of the Tornado event generated based on a call received by an endpoint.
Assuming the webhook request is:
curl -v -X POST https://<neteye.master>/tornado/webhook/event/ups?token=my-secret-token -d '{"ups": "001", "type": "critical", "message": "Battery level critical"}'
the configuration file ups_notifications.conf
would contain the following values:
{
"id": "ups",
"token": "my-secret-token",
"collector_config": {
"event_type": "ups_notification",
"payload": {
"source": "${@}"
}
}
}
the event received is:
{
"created_ms": 1713266596490,
"metadata": {
"tenant_id": "master",
},
"payload": {
"source":{
"message":"Battery level critical",
"type":"critical",
"ups":"001"
}
}
},
"type": "ups_notification"
}
Detailed information on how to configure webhooks in Tornado can the found inside the official Tornado documentation; in particular, the Webhook Collector documentation describes the architecture of the Webhook Collector and its configuration parameters and options.