1. Optional: Create a secret in RisingWave
First, create a secret in RisingWave to securely store a secret string. This secret will be used to validate incoming webhook requests from Segment. This is the recommended way to verify the signature. You could also use a raw string to verify.2. Create a table in RisingWave
Next, create a table configured to accept webhook data from Segment.
Or you can also use raw string for verification without secret:
3. Set up webhook in Segment
After configuring RisingWave to accept webhook data, set up Segment to send events to your RisingWave instance.RisingWave webhook URL
The webhook URL should follow this format:Configure webhook in Segment
For more detailed instructions, refer to the Segment’s Webhooks Destination Documentation and Webhooks (Actions) Destination Documentation.1
Access the Segment Workspace:
Log in to your Segment workspace.
Log in to your Segment workspace.
2
In the left sidebar, click on Connections > Add Destination.
- Search for
webhookin the list of available destinations. - Select Webhooks (Actions) and click Add destination to proceed.
3
- Select the data source that identifies the source you want to send events from and follow the steps to name your destination.
- Click on the tab Settings > Basic Settings > Shared Secret, enter the same secret string you used when creating the RisingWave secret (e.g.,
'TEST_WEBHOOK'). This ensures that Segment signs the payloads using this secret, allowing RisingWave to validate them. - Click on the tab Settings > Basic Settings > Enable Destination and make sure it is enabled.
4
Configure the webhook description on the Mappings tab.
- Click New Mapping and then Send.
- Choose the event type you want to send to RisingWave.
- Fill the configuration for the webhook requests based on the source information. You can also directly fill the values, filling RisingWave webhook URL as
URL,POSTasMethod.
4. Push data from Segment via webhook
With the webhook configured, Segment will automatically send HTTP POST requests to your RisingWave webhook URL whenever the specified events occur (e.g., pushes to the repository). RisingWave will receive these requests, validate the signatures, and insert the payload data into the target table.5. Further event processing
The data in the table is already ready for further processing. You can access the fields usingdata->'field_name' in SQL queries.
You can create a materialized view to extract specific fields from the JSON payload.
segmentb_events like a regular table to perform analytics, generate reports, or trigger further processing.