Applicable to Entuity v20.0 upwards
You can specify custom webhook rules so that a specific Entuity event is generated whenever a specific payload is received (and particular conditions pertaining to that specific payload are met). This is a custom webhook event, which is not the same as an out-of-the-box Entuity event or a custom Entuity event.
A rule is associated with an webhook group. All rules in an webhook group are evaluated against a received payload, stopping at the first one to succeed.
Click the Rules tab on the Custom Webhooks page to see a list of webhook mapping rules. A webhook mapping rule comprises the following:
- the definition of an Entuity event type.
- a mapping that allows this event to be populated from the payload fields.
- a list of conditions that are used to evaluate the payload, to see if it meets the requirements to generate the event.
From Entuity v20.0 P02 upwards, the Create Rule functionality can be found under the Payloads tab of the Custom Webhook page.
To add a custom webhook mapping rule:
- Navigate to the Rules tab (Entuity v20.0 GA)/Payloads tab (Entuity 20.0 P02 upwards) of the Custom Webhooks page. Click +Create Rule at the top of the page, or via the Overflow Menu.
You can also create a rule when viewing a particular payload. Select your preferred payload in the Payloads table, and then click Create Rule. You can use selected entries on the currently-selected payload tree as a guide when creating this new rule.
- The Create Rule form will open on the right side of the page.
- From the Group dropdown field, select the webhook group to which this rule will apply. If a payload is used for this rule, the Group selection will be made automatically.
- Specify a Rule Name.
- Click the Conditions field to open the Conditions form. The conditions will determine whether the payload meets the requirements for raising a webhook event. At least one condition is required for a rule.
- Click +Add Condition to add a new condition, or select from an existing condition in the list. If you are adding a new condition, you can specify the following parameters:
- Field - the key from which the value will be retrieved. If you have selected entries in the payload tree, these will be accessible from the Field dropdown.
- Type - dropdown field specifying the type into which the value will be converted, either:
- Operation - dropdown field specifying the operation that the value will use, can be:
- = [equals]
- != [not equals]
- like [if Type is 'String']
- > [greater than] [if Type is not 'String']
- >= [greater than or equals] [if Type is not 'String']
- < [less than] [if Type is not 'String']
- <= [less than or equals] [if Type is not 'String']
- In the Value to Match field, specify the value to compare to the value from the payload.
- Specify whether to Enable Rule.
- From the Event Name dropdown field, enter the name of the event to be created.
- Specify the severity of the event being created from the Severity dropdown field, selecting from one of the following:
- Specify the Event Source and the Event Details of the event to be created - these are informational entries that will appear in the Event Source and Event Details columns of the Events List dashlet table respectively. If you want the Event Source and/or Event Details columns to display information specific to the webhook, then this will need to be extracted from the payload itself when editing the rule.
- Enter an Event Description. This is also an informational entry.
- Click Done to save your changes, otherwise click Cancel.
To edit a rule:
- Navigate to the Rules tab of the Custom Webhooks page. Select the rule that you want to edit and click Edit Rule at the top of the page, or via the Overflow Menu or right-click Context Menu.
- The Edit Rule form will open on the right of the screen. This contains the same fields as when adding a rule.
- Make your desired changes and then click Done, otherwise click Cancel.
To delete a rule:
If you delete a webhook rule, it will not delete the webhook group.
- Navigate to the Rules tab of the Custom Webhooks page. Select the rule that you want to delete and click Delete Rule at the top of the page, or via the Overflow Menu or right-click Context Menu.
- A dialog window will appear, asking you to confirm your choice.