Connection with Elastic Using Webhook

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.

click on the Add new flow

Step 2: Click on the Add the initial trigger button.

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.

Search and select the Webhook component

Step 4: Create the credential by clicking on the + Add New Credential button.

Create the credential

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.

Name your credential and select Auth type

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.

provide the sample data structure

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.

Click on the Finish step button

Stage II: Select the Data Target

Step 1: Click on the Add a new action button

Add a new action

Step 2: Select the action component from the dropdown list. In this case, we have selected Google Spreadsheets

Select the action component

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

Configure the action for the selected Data Target

Step 4: Create the credential by clicking on the + Add New Credential button or choose the existing one if already created.

clicking on the + Add New Credential

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 Authenticate button

Click on the Save button once done.

Click on the Save button

Step 5: Complete the configuration by selecting the values that suit your requirements. Click on the Continue button once done.

Complete the configuration

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.

generate a sample from the component

Step 6: Check the summary and click on the Finish step button

Check the summary

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.

Running the Integration Flow

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.

Elastic Webhook URL Generated

Click on the Start Flow button from the top to make the integration flow live and running.

 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/
Jun 22, 2022

Contact Us

Not finding what you're looking for? Contact Us Directly