Event streaming

Push the audit log to your security tools within seconds of each event.

A stream delivers every audit event to one destination: Splunk's HTTP Event Collector, Microsoft Sentinel, or any HTTPS endpoint as a signed webhook. Use a webhook for tools that take JSON over HTTPS, such as Datadog, Sumo Logic, an Azure Logic App or a function of your own.

  • Add streams in Manage org › Event Streaming, or through the endpoints here with a token holding the streams scope.
  • An organization streams to up to 10 destinations.
  • Adding, pausing, resuming and removing a stream are themselves audit events.

A SIEM that prefers to pull can poll the audit log instead.

Add a webhook
curl "https://tensorworks.net/enterprise/v1/streams" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "SOC",
    "kind": "webhook",
    "url": "https://example.com/tensorworks-events"
  }'

Event streaming

Delivery

  • From now on: a new stream delivers what happens after it is added. Read earlier events from the audit log.
  • In order: events arrive oldest first, up to 500 in a request.
  • At least once: a batch whose answer was lost is sent again. Keep each event once by its id.
  • Retried: a destination that answers anything but 2xx, or does not answer within 10 seconds, is tried again after 5 seconds, doubling each time up to an hour. Nothing is skipped: delivery continues from the first event not taken. The stream's error says what went wrong.
  • Paused: a paused stream keeps its place and delivers what it missed once resumed.
  • Public HTTPS only: a destination must be an https:// URL at a public address, with a valid certificate. Redirects are not followed.

Streams stop delivering while the organization is not on Enterprise.

Event streaming

The stream object

Fields

id string
The stream’s id.
name string
Its name.
kind string
splunk, sentinel or webhook.
url string
Where events are sent.
enabled boolean
Whether it is delivering. False while paused.
created_at string
When it was added.
index string | null
Splunk: the index events are written to, if one was named.
tenant_id, client_id, dcr_id, stream_name string | null
Sentinel: the directory, application, data collection rule and stream it sends to.
delivered_at string | null
When it last delivered, to within a minute.
error string | null
Why its last delivery failed. Null once it delivers again.
failed_at string | null
When that failure began.

Secrets (a Splunk token, an Entra client secret, a webhook's signing secret) are never answered after the stream is made.

A stream
{
  "id": "d3a9…",
  "name": "SOC",
  "kind": "webhook",
  "url": "https://example.com/tensorworks-events",
  "enabled": true,
  "created_at": "2026-11-10T12:00:41.300Z",
  "index": null,
  "tenant_id": null,
  "client_id": null,
  "dcr_id": null,
  "stream_name": null,
  "delivered_at": "2026-11-10T14:03:25.012Z",
  "error": null,
  "failed_at": null
}

GET /streams

List streams

Every stream of the organization, oldest first. The list is not paged: next_cursor is always null.

GET /streams
curl "https://tensorworks.net/enterprise/v1/streams" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"
200 OK
{
  "data": [
    {
      "id": "d3a9…",
      "name": "SOC",
      "kind": "webhook",
      "url": "https://example.com/tensorworks-events",
      "enabled": true,
      "created_at": "2026-11-10T12:00:41.300Z",
      "index": null,
      "tenant_id": null,
      "client_id": null,
      "dcr_id": null,
      "stream_name": null,
      "delivered_at": "2026-11-10T14:03:25.012Z",
      "error": null,
      "failed_at": null
    }
  ],
  "next_cursor": null
}

POST /streams

Add a stream

Adds a stream and starts delivering. Answers 201 with the stream. A webhook's answer also carries its signing secret, this once.

Body

name string Required
A name for the stream, 1–100 characters.
kind string Required
splunk, sentinel or webhook.
url string Required
A public https:// URL: the HEC endpoint, the data collection endpoint, or your webhook.
token string
Splunk, required: the HTTP Event Collector token.
index string
Splunk: an index the token may write to.
tenant_id string
Sentinel, required: the Microsoft Entra directory (tenant) id.
client_id string
Sentinel, required: the application (client) id.
client_secret string
Sentinel, required: the application’s client secret.
dcr_id string
Sentinel, required: the data collection rule’s immutable id, dcr-….
stream_name string
Sentinel, required: the rule’s stream, such as Custom-TensorworksAudit_CL.

A body that is refused answers 400 invalid_request with a message saying which field to fix.

POST /streams
curl "https://tensorworks.net/enterprise/v1/streams" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Splunk Cloud",
    "kind": "splunk",
    "url": "https://http-inputs-example.splunkcloud.com/services/collector/event",
    "token": "$HEC_TOKEN",
    "index": "security"
  }'
201 Created · a webhook
{
  "data": {
    "id": "d3a9…",
    "name": "SOC",
    "kind": "webhook",
    "url": "https://example.com/tensorworks-events",
    "enabled": true,
    "created_at": "2026-11-10T12:00:41.300Z",
    "index": null,
    "tenant_id": null,
    "client_id": null,
    "dcr_id": null,
    "stream_name": null,
    "delivered_at": null,
    "error": null,
    "failed_at": null,
    "secret": "4b1f…64 hexadecimal characters"
  }
}

GET /streams/{stream}

Get a stream

One stream, with whether it is delivering and its last error. Poll it to monitor delivery.

GET /streams/{stream}
curl "https://tensorworks.net/enterprise/v1/streams/$STREAM" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"
A failing stream
{
  "data": {
    "id": "d3a9…",
    "name": "SOC",
    "kind": "webhook",
    "url": "https://example.com/tensorworks-events",
    "enabled": true,
    "created_at": "2026-11-10T12:00:41.300Z",
    "index": null,
    "tenant_id": null,
    "client_id": null,
    "dcr_id": null,
    "stream_name": null,
    "delivered_at": "2026-11-10T14:03:25.012Z",
    "error": "The destination answered 503.",
    "failed_at": "2026-11-10T14:10:02.440Z"
  }
}

PATCH /streams/{stream}

Pause or resume

Pauses a stream or resumes it. Resuming clears its error, tries again at once and delivers everything logged while it was paused.

Body

enabled boolean Required
false to pause, true to resume.
Pause
curl -X PATCH "https://tensorworks.net/enterprise/v1/streams/$STREAM" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'

POST /streams/{stream}/test

Send a test event

Sends one made-up event, stream.test, to the destination now, in the same form as real events. It answers { "data": { "delivered": true } }, or 400 invalid_request with what the destination said. The test event is in no log.

POST /streams/{stream}/test
curl -X POST "https://tensorworks.net/enterprise/v1/streams/$STREAM/test" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"

DELETE /streams/{stream}

Remove a stream

Removes a stream and forgets its secret. Answers 204 with no body. Events it had not delivered are not sent.

DELETE /streams/{stream}
curl -X DELETE "https://tensorworks.net/enterprise/v1/streams/$STREAM" \
  -H "Authorization: Bearer $TENSORWORKS_TOKEN"

Destinations

Splunk

Events go to Splunk's HTTP Event Collector, one JSON event each, with source tensorworks, sourcetype tensorworks:audit and the event's own time.

  1. In Splunk, add an HTTP Event Collector token under Settings › Data inputs, with indexer acknowledgement off.
  2. Add a stream of kind splunk with the collector's url, ending in /services/collector/event, its token, and optionally an index the token may write to.
  3. Send a test event and search for sourcetype="tensorworks:audit".

Requests carry Authorization: Splunk <token>. The collector must be reachable from the internet with a certificate a public authority issued, as Splunk Cloud's is.

What Splunk receives
{"time": 1794405802.481, "source": "tensorworks", "sourcetype": "tensorworks:audit", "index": "security", "event": { …the event… }}
{"time": 1794405803.007, "source": "tensorworks", "sourcetype": "tensorworks:audit", "index": "security", "event": { … }}

Destinations

Microsoft Sentinel

Events go to your Log Analytics workspace through Azure Monitor's Logs Ingestion API, one row per event.

  1. Create a custom table in the workspace, such as TensorworksAudit_CL, with the columns shown, and a data collection rule whose stream declares the same columns and sends them to the table.
  2. Register an application in Microsoft Entra, give it a client secret, and grant it Monitoring Metrics Publisher on the data collection rule.
  3. Add a stream of kind sentinel with the logs ingestion endpoint as url (the rule's own, or a data collection endpoint's), the directory's tenant_id, the application's client_id and client_secret, the rule's immutable id as dcr_id, and its stream_name, such as Custom-TensorworksAudit_CL.
  4. Send a test event. A new role assignment can take a few minutes to apply.

Tensorworks signs in to Microsoft Entra as the application and posts to <url>/dataCollectionRules/<dcr_id>/streams/<stream_name>. Details holds the event's details object.

Stream columns
TimeGenerated: datetime, EventId: string, Action: string, Category: string,
ActorType: string, ActorId: string, SessionId: string,
EntityType: string, EntityId: string, Organization: string,
Project: string, Resource: string, Scope: string, Details: dynamic
Find failed sign-ins
TensorworksAudit_CL
| where Action == "user.login_failed"
| summarize Failures = count() by ActorId, tostring(Details.ip), bin(TimeGenerated, 10m)
| where Failures >= 5

Destinations

Webhooks

A webhook receives a POST whose JSON body holds events, up to 500 at a time, each as the audit log answers it. Answer any 2xx within 10 seconds. Anything else is delivered again.

Each delivery is signed with the stream's secret, shown once when the stream is added. The Tensorworks-Signature header holds the time t in Unix seconds and v1, the HMAC-SHA256, in hexadecimal, of t, a period and the raw body. Check it before trusting a delivery, and refuse an old t so a captured delivery can't be replayed.

Request headers

Content-Type string
application/json.
Tensorworks-Signature string
t=<unix seconds>,v1=<hex HMAC-SHA256>.
User-Agent string
Tensorworks-Event-Stream/1.
A delivery
{
  "events": [
    {
      "id": "5f0c9a1e2b7d4c3a8e6f1b20",
      "at": "2026-11-10T14:03:22.481Z",
      "action": "notes.created",
      "category": "resource",
      "actor": {
        "type": "user",
        "id": "8c1d…"
      },
      "session": "b7e4…",
      "entity": {
        "type": "notes",
        "id": "41aa…"
      },
      "context": {
        "organization": "2f9b…",
        "scope": "resource",
        "resource": "c05e…"
      },
      "details": {
        "fields": [
          "body",
          "sender_user_id",
          "sender_name"
        ]
      }
    }
  ]
}
Verify a delivery
import { createHmac, timingSafeEqual } from 'node:crypto';

// header: Tensorworks-Signature: t=<unix seconds>,v1=<hex>
// body: the request's raw bytes, before any JSON parsing
function verified(header, body, secret) {
  const [, t, v1] = header.match(/^t=(\d+),v1=([0-9a-f]{64})$/) ?? [];
  if (!t || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = createHmac('sha256', secret).update(`${t}.${body}`).digest();
  return timingSafeEqual(expected, Buffer.from(v1, 'hex'));
}

Questions or something missing? Contact us.