You can create an integration flow on Elastic and trigger it with the alerts sent from TrendSpider via Webhook connection. The integration flow on Elastic accepts the HTTP requests in JSON. In this document, you will explore adding a new flow with Webhook as an initial trigger for receiving the data from TrendSpider.
Stage I: Configure the Webhook (Data Source)
Step 1: Log in to Elastic, go to Dashboard, and click on the Add new flow button.
Step 2: Click on the Add the initial trigger button.
Step 3: Search and select the Webhook component from the list of integration components and click on the Choose Webhook button.
Step 4: Create the credential by clicking on the + Add New Credential button.
Name your credential and select Auth type. Once done, then click on the Save button. For more information on credentials, please check the documentation- Securing Your Webhooks.
You can proceed to provide the sample data structure, which the webhook expects from TrendSpider. To proceed with this action, click on the Send Sample Request button or manually add a sample. You can also skip this configuration.
Webhook Body Example (JSON)
{
"petname": "Gromit",
"petstatus": "Sold",
}
Incoming Webhook URL Example:
https://in.elastic.io/sample/89918152-170c-437d-955c-6c9653a7abc0
Step 5: Click on the Finish step button and proceed with the next step.
Stage II: Select the Data Target
Step 1: Click on the Add a new action button
Step 2: Select the action component from the dropdown list. In this case, we have selected Google Spreadsheets
Step 3: Configure the action for the selected Data Target (component). In this case, we have configured the action- Add Spreadsheet Row for Google Spreadsheets.
To know more about different integration components you can check the section- Components
Step 4: Create the credential by clicking on the + Add New Credential button or choose the existing one if already created.
Configure the values in the field, click on the Authenticate button, and Elastic will request access to the component. Approve the same and the component will be authenticated.
Click on the Save button once done.
Step 5: Complete the configuration by selecting the values that suit your requirements. Click on the Continue button once done.
You can generate a sample from the component by automatically retrieving the sample or adding the sample manually. You can also skip generating the sample.
Step 6: Check the summary and click on the Finish step button
Stage III: Running the Integration Flow
Once you have clicked the Finish Step button, you will view the integration flow. You can add more components or click on the Publish Draft button from the top.
Elastic Webhook URL will be generated at this stage. You can copy this URL and paste it while creating the Trading Bot in TrendSpider or setting up Dynamic or Multi-Factor Alert.
Click on the Start Flow button from the top to make the integration flow live and running.
Whenever TrendSpider will send the data to this Webhook URL, the integration flow will be triggered and the action defined in the added component shall get into the motion.
Related Elastic Documentation
DOCUMENT | REFERENCE |
---|---|
Securing Your Webhooks | https://docs.elastic.io/getting-started/webhooks-flow.html#securing-your-webhooks |
Integration Components | https://docs.elastic.io/components/ |