Webhooks
Overview
The SearchStax Managed Search service can POST Heartbeat and Threshold Alerts to the webhook endpoints of external Alerting and Incident Management systems. See our blog SearchStax Webhooks: Better Solr Alerting through Extensibility for background on webhook features.
The webhook messages are invoked by Heartbeat and Threshold Alerts, and can carry a payload of data about the alert and the system that triggered it.
Contents of this page:
What is a Webhook?
Webhooks are user-defined HTTP callbacks. They are usually triggered by some event, such as an alert changing status in SearchStax. When the event occurs, the source site (SearchStax) makes an HTTP request to the URL configured for the webhook. Events on one site can invoke behavior on another.
A common use is to notify bug-tracking systems and alerting systems, although the SearchStax webhook mechanism can reach out to any web application that has a webhook endpoint.
Defining a Webhook
A webhook must be defined in the SearchStax Managed Search Dashboard before it can be referenced in an alert. Look for the Webhooks entry in the navigation pane on the left margin of the page.
Click the Create Webhook button to open the webhook editor.
JSON must be flat!
The payload list must be flat with no nested JSON objects.
Control | Description |
---|---|
Name | The name of the webhook. It will appear in a droplist of webhooks in the alerts editor. |
URL | The URL of the webhook endpoint of the target application. |
Ignore SSL Validation | Sometimes the target of your webhook post is using SSL with a self-signed certificate. This setting overrides the certificate check. |
Paused | Deactivate this webhook without having to delete it. |
Payload | The payload is a JSON list of field keys and values. The fields are the labels expected by the target application. The values are predefined SearchStax variables. The list must be flat with no nested JSON objects. |
Update | The Update button saves the webhook and closes the editor. |
Adding Webhooks to an Alert
The alert editor offers droplists that let you associate your webhooks with specific alerts.
Predefined Variables
SearchStax email alerts report various internal values to the user. These values are available as predefined variables to put into the payload of the webhook.
Variable | Description | Example |
---|---|---|
$ALERT_CURRENT_VALUE | The current value of the metric. | “0.01” |
$ALERT_ID | The internal ID number of the alert. | “6012” |
$ALERT_METRIC | The name of the alert metric. | “os.SystemCpuLoad” |
$ALERT_STATUS | Open or closed. | “OPEN” |
$ALERT_THRESHOLD_VALUE | The threshold. | “10.0” |
$ALERT_THRESHOLD_OPERATOR | The relation between the current value and the threshold. | “>” |
$ALERT_TITLE | The name of the alert. | “Server 5 below 10% CPU” |
$ALERT_TYPE | Heartbeat or Threshold. | “Threshold” |
$DATE | The time in UTC. | “2019-12-20T18:18:39+00:00” |
$DEPLOYMENT_NAME | The name of the deployment. | “Films” |
$DEPLOYMENT_UID | The ID number of the SearchStax deployment. | “ss123456” |
$HOSTNAME | The name of the server that issued the alert. | “ss123456-5” |
Contact Us!
Don’t hesitate to reach out to the SearchStax Support Desk. We are happy to answer your questions.