Trigger an xMatters Flow to alert xMatters groups and easily integrate with other applications when a Sematext alert rule is met.
An updated version of this integration is available. You can install the new version right from the Workflow Templates directory within your xMatters instance. Learn more.
- Sematext
- xMatters account - If you don't have one, get one!
Sematext will create an xMatters alert when new Logs or Events in Sematext meet specific conditions.
Although this step is not required, it is recommended. This will enhance security and ensure the integration does not unintentionally break when a password is changed.
Note: If you are installing this integration into an xMatters trial instance, you don't need to create a new user. Instead, locate the "Integration User" sample user that was automatically configured with the REST Web Service User role when your instance was created and assign them a new password. You can then skip ahead to the next section.
To create an integration user:
- Log in to the target xMatters system.
- On the Users tab, click the Add New User icon.
- Enter the appropriate information for your new user. Example User Name Sematext_API_User
- Assign the user the REST Web Service User role.
- Click Save.
To import the communication plan:
- In the target xMatters system, on the Developer tab, click Import Plan.
- Click Browse, and then locate the downloaded communication plan: Sematext
- Click Import Plan.
- Once the communication plan has been imported, click Plan Disabled to enable the plan.
- In the Edit drop-down list, select Access Permissions.
- Add the Sematext_API_User or Make the Plan Accessible by All.
- Save Changes.
- In the Edit drop-down list, select Forms.
- For the Sematext Alert form, in the Not Deployed drop-down list, click Enable for Web Service.
- After you Enable for Web Service, the drop-down list label will change to Web Service.
- In the Web Service drop-down list, click Sender Permissions.
- Add the Sematext_API_User you created above, and then click Save Changes.
- In the Edit drop down list on the Sematext Alerts Communication Plan Click Flow.
- Click on the Sematext Alert Flow.
- On the Flow Canvas, Double Click on the step named Sematext Flow Trigger. This is the inbound http trigger for the Flow.
- Change the Authenticating User to the Sematext_API_User
You must supervise this user and it must have a Web Service User Role. If you cannot select the Sematext_API_User it is because you do not supervise that user or they do not have the REST Web Service User role. When you create a new user, you are automatically set as that users' supervisor. If you do not see the user that you created, most likely the REST Web Service role is missing.
- Copy the URL listed under the Trigger section.
You will need this URL for configuring Sematext.
By default, this integration will create an xMatters Alert with basic property values from Sematext. You can customize this integration to include more properties and also add additional Flow Steps to post to chat ops tools, create tickets or anything else you can dream of.
Note::If you customize the flow, just make sure that you do not remove the xMatters Create Event (Sematext Alert) Step. This step creates the actual xMatters alert. This step can come right after Create Sematext Alert Step or after other steps that you add to the canvas, it's up to you.
Here is an example of a possible Flow:
- In the Triggers tab under HTTP Requests section, click the Cog and then Edit.
- Go to the OUTPUTS Tab and add new Step Outputs. Outputs are values that will be available for subsiquent steps.
- Go to the SCRIPT tab and modify your script appropriately.
- Each Output added in Step 2 will need to be mapped to a value in your payload. This takes the incoming values from Sematext and sets the xMatters properties to hold these values.
Example: output['New Output'] = payload['Another value'];
output['New Output'] - this is an output added in step 2. The output name is "New Output"
payload['Another value'] - this is a value in your payload with the key "Another value" sent to xMatters from Sematext.
-
Exit Flow Designer.
-
Navigate to the Forms section of Sematext Communication Plan.
-
Beside Sematext Alert Form, click Edit and go to Layout.
- Create new Properties.
-
Drag new Properties onto the Form.
-
Save Changes.
-
Make any required changes to Messages and Responses.
Once you have added new properties to the Sematext Alert form, they will become available in the xMatters Create Event (Sematext Alert) Step for you to map payload properties to.
- On the Flow Canvas double click the xMatters Create Event (Sematext Alert) Step
- Drag items from the right to the appropriate fields on the left. Any new fields you have added to the form layout will be available here.
Follow instructions here to create new Custom Notification Hooks in Sematext: https://sematext.com/docs/integration/alerts-webhooks-integration/
Here is how you should configure each value:
Name: xMatters Alert
URL: Set the URL (hook url) field to the xMatters Inbound Integration Endpoint URL. Get the xMatters Inbound Integration Endpoint URL here
Set Data as: JSON
HTTP method: POST
Add Parameters:
description = $description
title = $title
app_id = $app_id
group = Your xMatters Target Group Name
NOTE: You will want to create an Sematext Notification Hook for each group you want to target in xMatters. Each Notification Hook will be associated to a Sematext Alert Rule. By changing the group parameter, you can target different xMatters groups depending on the alert rule triggered in Sematext.
Add any additional parameters / values you want to pass to xMatters
Follow instructions here to create new Alert Rule: https://sematext.com/docs/alerts/
Configure your alert rule to use the Custom Notification Hook created in the last step.
Trigger a new Sematext Alert and check that it makes its way into xMatters.
You can check the Activity Log of Flow Designer with these instructions. https://help.xmatters.com/ondemand/xmodwelcome/flowdesigner/activity-panel.htm