- 02 Jan 2025
- 3 Minutes to read
- Print
- Dark
Tutorial: Creating a Webhook Adapter
- Updated on 02 Jan 2025
- 3 Minutes to read
- Print
- Dark
LimaCharlie supports webhooks as a telemetry ingestion method. Webhooks are technically cloud Adapters, as they cannot be deployed on-prem or through the downloadable Adapter binary.
Webhook adapters are created by enabling a webhook through the cloud_sensor
Hive feature. Webhook creation will enable a specific URL that can receive webhooks from any platform. Received data will be ingested in LimaCharlie as a Sensor, similar to an Office365 or Syslog Adapter.
Creating a Webhook Adapter
Webhook adapters can be created either through the webapp, API, or CLI. Before creation, let's look at the basic webhook configuration and values necessary to build the adapter.
When the above configuration is provided to LimaCharlie, a webhook adapter will appear and be available for webhook event ingestion. Here's an example of creating the above record through the LimaCharlie CLI:
After creating the webhook, you will be provided with a geo-dependent URL, respective to your LimaCharlie Organization location. You can also retrieve your webhook URLs with either of the following commands:
REST API: getOrgURLs
Python SDK:
Using the webhook adapter
After capturing the webhook URL in the previous step, only a few more pieces of data are necessary to construct the webhook ingestion.
Let's assume the returned domain looks like 9157798c50af372c.hook.limacharlie.io
, the format of the URL would be:
https://9157798c50af372c.hook.limacharlie.io/OID/HOOKNAME/SECRET
, where:
OID is the Organization OID provided in the configuration above.
HOOKNAME is the name of the hook provided in the configuration above.
SECRET is the secret value provided in the configuration. You can provide the secret value in the URL or as an HTTP header named
lc-secret
.
Supported Webhook Format
When sending data via POST requests to the URL, the body of your request is expected to be one or many JSON events. Supported formats include:
Simple JSON object:
{"some":"data"}
List of JSON objects:
[{"some":"data"},{"some":"data"}]
Newline separated JSON objects like:
Or, one of the above, but compressed using gzip.
With the completed webhook URL, you can begin sending events and will see them in the Timeline for your webhook Adapater.