To receive and handle logs from Esadax using Log Drains, follow the framework-agnostic steps below. These apply to any backend that supports HTTP routing and environment configuration.
Create an HTTP endpoint (e.g., /esadax/logs) in your application that accepts POST requests. This endpoint will receive log data from Esadax.
POST requests for security and consistency.Example (pseudocode):
POST /esadax/logs
Content-Type: application/json
Body: { logs: [...] }
Esadax sends a signature header (x-esadax-signature) with each log payload.
INTEGRATION_SECRET in your environment (from your Esadax dashboard).Signature Verification Example (Node.js-style pseudocode):
const crypto = require('crypto');
function verifySignature(secret, body, signature) {
const hmac = crypto.createHmac('sha256', secret);
hmac.update(body);
const expectedSig = hmac.digest('hex');
return expectedSig === signature;
}
In the Esadax dashboard:
lambda, edge, or static).production or staging).User-Agent.Once verified, parse the payload and forward it to your preferred log storage or analytics tool (e.g., Datadog, Loki, Sentry, Elasticsearch).
Example log handling flow:
Always respond to Esadax with the right HTTP status code:
200 OK: Successfully received and verified the payload400 Bad Request: Malformed or missing data403 Forbidden: Invalid signatureBefore going live:
curl or Postman to send simulated payloads.curl -X POST https://yourdomain.com/esadax/logs \
-H "Content-Type: application/json" \
-H "x-esadax-signature: <calculated_signature>" \
-d '{ "logs": [...] }'
| Step | Description |
|---|---|
| 1 | Create a secure log endpoint |
| 2 | Implement signature verification |
| 3 | Configure log drains in Esadax |
| 4 | Use HTTPS and optional IP validation |
| 5 | Process and route log data |
| 6 | Send proper HTTP responses |
| 7 | Test the setup with valid/invalid payloads |