Documentation

Export to any HTTPS endpoint

Signed NDJSON batches for your own collector, Vector, Logstash, Cribl, or an Azure Function that feeds Microsoft Sentinel.

What ModelRiver sends

HTTP
1POST /ingest HTTP/1.1
2Content-Type: application/x-ndjson
3Authorization: Bearer <token> (only when you set a token)
4X-ModelRiver-Timestamp: 1795600800
5X-ModelRiver-Signature: 5d41402abc4b2a76b9719d911017c592...
6X-ModelRiver-Batch-Id: 0193a4f2-..._0193a4f3-...
7 
8{"id":"0193a4f2-...","inserted_at":"2026-11-25T10:00:00.123456Z","action":"security.admin_key_created",...}
9{"id":"0193a4f3-...","inserted_at":"2026-11-25T10:00:01.002000Z","action":"data.audit_export_updated",...}

The body is NDJSON: one event object per line, each line ending in a newline. A batch holds at most 500 events and 1 MB.

Your endpoint must:

  • answer 2xx once it has stored the batch. Answer 408, 429 or 5xx to have it retried later, optionally with Retry-After: <seconds>. Any other status is treated as a configuration error and not retried.
  • answer within 60 seconds.
  • not redirect. Redirects are never followed.
  • use HTTPS with a certificate from a public certificate authority, on a host that resolves to public addresses.

Verify every request with the signature recipe, and remove duplicates on the event id.

Configure the export

In Organization settings → Audit log export, choose Generic HTTPS / Sentinel, enter the Endpoint URL, and optionally a Bearer token. Save, and copy the signing secret: it is shown only once. Then choose Send test.

If you change the URL and leave the token empty, the saved token is removed, so it is never sent to the new URL.

The page shows the URL to organization admins. Don't put a secret in it: use the bearer token, or rely on the signature.

Microsoft Sentinel

Sentinel's Logs Ingestion API needs a Microsoft Entra access token, so ModelRiver can't post to it directly. Put a small Azure Function in front of it. The function verifies ModelRiver's signature and forwards the events with its managed identity.

All steps below are untested:

  1. In Azure Monitor, create a data collection endpoint, a custom table such as ModelRiverAudit_CL in your Sentinel workspace, and a data collection rule (DCR) whose stream maps the event fields to the table. Add a TimeGenerated column computed from inserted_at.
  2. Create a Python Azure Function app with a system-assigned managed identity. Give the identity the Monitoring Metrics Publisher role on the DCR.
  3. Add an HTTP-triggered function with authLevel anonymous: the signature is what authenticates ModelRiver. Store the signing secret in the app settings as MODELRIVER_SIGNING_SECRET, along with DCE_ENDPOINT, DCR_IMMUTABLE_ID and DCR_STREAM (for example Custom-ModelRiverAudit_CL).
PYTHON
1import hashlib
2import hmac
3import json
4import os
5import time
6 
7import azure.functions as func
8from azure.identity import DefaultAzureCredential
9from azure.monitor.ingestion import LogsIngestionClient
10 
11app = func.FunctionApp()
12client = LogsIngestionClient(os.environ["DCE_ENDPOINT"], DefaultAzureCredential())
13 
14 
15@app.route(route="modelriver-audit", methods=["POST"], auth_level=func.AuthLevel.ANONYMOUS)
16def modelriver_audit(req: func.HttpRequest) -> func.HttpResponse:
17 body = req.get_body()
18 timestamp = req.headers.get("x-modelriver-timestamp", "0")
19 signature = req.headers.get("x-modelriver-signature", "")
20 expected = hmac.new(
21 os.environ["MODELRIVER_SIGNING_SECRET"].encode(),
22 timestamp.encode() + b"." + body,
23 hashlib.sha256,
24 ).hexdigest()
25 if abs(time.time() - int(timestamp)) > 300 or not hmac.compare_digest(expected, signature):
26 return func.HttpResponse(status_code=401)
27 
28 events = [json.loads(line) for line in body.splitlines() if line]
29 client.upload(rule_id=os.environ["DCR_IMMUTABLE_ID"], stream_name=os.environ["DCR_STREAM"], logs=events)
30 return func.HttpResponse(status_code=204)
  1. Use the function URL (https://<app>.azurewebsites.net/api/modelriver-audit) as the Endpoint URL in ModelRiver, with no token.

If upload raises, the function answers 500 and ModelRiver retries the batch. To remove duplicates in KQL, use ModelRiverAudit_CL | summarize arg_max(TimeGenerated, *) by id.

Other collectors

Anything that accepts NDJSON over HTTPS works, for example Vector's http_server source, Logstash's http input or Cribl's HTTP source. Verify the signature in a transform or proxy if the collector can't do it itself.