audit.ndjson. You can
use the file as input to Splunk or another SIEM. See Audit export rules
for cursor validity, throttling, and self-hosted setup.
Before you start
- Grant the key’s owner View audit history (
audit.view) in the target organization, then create an API key. - Make sure audit visibility is enabled on Den API
(
DEN_AUDIT_VISIBILITY_ENABLED, on by default). - Set
DEN_API_URLtohttps://api.openworklabs.comfor Cloud or to your own Den API base URL for self-hosted. SetDEN_API_KEYto the organization key. The requests send it asx-api-key, with noBearerprefix.
Follow the cursor
- Call
GET /v1/audit/exportwithoutcursor. - Read
X-Audit-Next-Cursorfrom the successful response headers, not from the NDJSON or CSV body. If present, URL-encode its full value as the next request’scursor. - Stop when a successful response omits
X-Audit-Next-Cursor. An empty result or a final page with exactlylimitevents can both end the export.
Download every NDJSON page
Save the script asexport-audit.sh in a new directory and run
bash export-audit.sh. It appends successful pages to audit.ndjson.partial
and saves the next cursor in audit.cursor. When it finishes, use the final
audit.ndjson file as your SIEM input. Keep the files and error output private.
--data-urlencode options to args on
every iteration. See the generated audit export reference
for the available filters.
To download CSV instead, start without a cursor and add
--data-urlencode 'format=csv' to the single-page command. See
Combine pages before saving or joining CSV pages.
Resume after an error
- Request failed: Fix the error, then run
bash export-audit.shfrom the same directory with the same filters. The script loadsaudit.cursorand appends the remaining pages. For your own client, save the next cursor only after processing the current page. - Throttled: Leave the key idle for longer than its throttling window,
then rerun the script. It retries a
401once after 61 seconds. If401persists, check the key and its settings before trying again. - Cursor expired or filters changed: Start in a new directory without a cursor. See Keep pages in the same snapshot.
- Interrupted while writing a page: Check the partial output for an incomplete or duplicate page before using it.
Check a self-hosted proxy
If you expect another page, inspect the headers withcurl --dump-header -
in place of --dump-header page.headers in the first-page command. If the
cursor is missing, check the self-hosted proxy rules.
See How export snapshots and cursors work
for what a snapshot includes and why it is not a continuous feed.