Send CMP audit events to Splunk

Collect CMP audit events into Splunk with a durable cursor and tested page-forwarding examples. Draft release documentation.

Production availability · November 18, 2026

Audit export on cloud.synaccess.com is awaiting activation. You can prepare your CMP role, credentials and collector now. Begin polling after Synaccess confirms that capture and export are active.

Collect the CMP audit API from your integration tooling and forward the event JSON to a Splunk HTTP Event Collector (HEC) input. The Bash collector below reads one account, forwards each event, and resumes from its saved position.

How collection works

  1. Request a page from CMP using an initial since or your saved cursor.
  2. Send every event in that page to Splunk.
  3. Save next_cursor after the destination accepts the entire page.
  4. Fetch the next page immediately when has_more is true. Once caught up, wait for your configured polling interval.

Your integration operates the collection loop and stores its checkpoint. CMP makes saved records available through the API after their audit write commits. Return order can differ from occurred_at or recorded_at; a delayed save can become visible later. Continue with the cursor rather than substituting the last event's timestamp. The initial since boundary and 45-day API access window use the database-assigned recorded_at capture timestamp, not transaction commit time.

Prepare CMP and Splunk

  1. Choose a named CMP user for collection. In Team → Roles, enable Read account audit history under Account privileges. Assign that role directly to the user in Team → Members. Grant only the other permissions the user needs. A device-group role alone does not grant account-wide audit access. Account owners and enterprise administrators already have access.
  2. Sign in as that user and open API → API Access → Create token. Store the personal access token (PAT) in your secret store. The token inherits the user's current account and device permissions. If enforced SSO prevents creating or managing a token for the intended user, contact Synaccess support with the account and username. Keep SSO enabled and keep the token value out of the support request.
  3. For rotation, create a replacement PAT with access to the same account, update the collector's secret, and resume from the existing checkpoint. Verify a successful read before revoking the old PAT.

Have your Splunk administrator provide an enabled HEC input, its full HTTPS event URL, and a token authorized for the intended index. The example uses the token's default index and the sourcetype synaccess:cmp:audit.

Destination acceptance

This example requires an HTTP success response and HEC code: 0 for each event. That means accepted for processing. If your Splunk Enterprise input uses indexer acknowledgment, extend the integration to track the channel and acknowledgment IDs before saving the cursor. For Splunk Cloud, use an ingestion method supported by your deployment. See Splunk's indexer acknowledgment guidance.

The example uses Bash, jq, and curl 7.76 or later. Keep the checkpoint in a protected, persistent working directory. Run one collector per directory and CMP account.

Environment variableValue
CMP_PATThe named user's PAT, loaded from your secret store.
SPLUNK_HEC_URLFull HTTPS event URL supplied by your Splunk administrator, typically ending in /services/collector/event.
SPLUNK_HEC_TOKENHEC token for that destination, loaded from your secret store.
START_ATA fixed RFC 3339 UTC capture time for the first page. To collect new activity, record the output of date -u +%Y-%m-%dT%H:%M:%SZ once. Set it before generating your test event and reuse it until the first checkpoint is saved. For retained history, use your chosen time within available coverage.
CMP_BASE_URLOptional. Defaults to https://cloud.synaccess.com.
POLL_SECONDSOptional. Defaults to 60 seconds between polls once caught up.

Run the collector

Export the environment variables, save this block as collect-audit.sh, and run bash collect-audit.sh from the checkpoint directory. It fetches additional pages immediately while catching up. On restart it uses audit.cursor if present.

#!/usr/bin/env bash
set -euo pipefail
umask 077
: "${CMP_PAT:?}" "${SPLUNK_HEC_URL:?}" "${SPLUNK_HEC_TOKEN:?}"
base=${CMP_BASE_URL:-https://cloud.synaccess.com}
poll=${POLL_SECONDS:-60}
[[ $poll =~ ^[1-9][0-9]*$ ]] || { echo "POLL_SECONDS must be a positive integer." >&2; exit 1; }
work=$(mktemp -d ./.cmp-audit.XXXXXX)
trap 'rm -rf "$work"' EXIT

while true; do
  if [[ -e audit.cursor ]]; then
    cursor=$(cat audit.cursor)
    [[ -n $cursor ]] || { echo "Checkpoint is empty. Inspect it before restarting." >&2; exit 1; }
    query="cursor=$cursor"
  else
    query="since=${START_AT:?Set the fixed UTC start time for the first request.}"
  fi

  status=$(curl --silent --show-error --max-time 15 --retry 4 --retry-connrefused \
    --get --header "Authorization: Bearer $CMP_PAT" --data-urlencode "$query" \
    --data-urlencode "limit=500" --output "$work/page" --write-out '%{http_code}' \
    "${base%/}/v1/audit-events")
  if [[ $status != 200 ]]; then
    echo "CMP returned HTTP $status. Checkpoint preserved." >&2
    jq -c '{error, request_id}' "$work/page" >&2
    exit 1
  fi
  jq -se 'length == 1 and (.[0] | (.events | type == "array") and
    (.next_cursor | type == "string" and length > 0) and (.has_more | type == "boolean")
    and (.coverage_gaps | type == "array"))' "$work/page" >/dev/null
  jq -c '.coverage_gaps[] | {coverage_gap: .}' "$work/page" >&2
  jq -c '.events[] | (.occurred_at | rtrimstr("Z") | split(".")) as $t | {
    time: (($t[0] + "Z" | fromdateiso8601) + ("0." + ($t[1] // "0") | tonumber)),
    sourcetype: "synaccess:cmp:audit", event: .
  }' "$work/page" > "$work/events"

  while IFS= read -r event; do
    status=$(printf '%s' "$event" | curl --silent --show-error --max-time 15 \
      --header "Authorization: Splunk $SPLUNK_HEC_TOKEN" --header 'Content-Type: application/json' \
      --data-binary @- --output "$work/reply" --write-out '%{http_code}' "$SPLUNK_HEC_URL")
    if [[ $status != 2?? ]] || ! jq -se 'length == 1 and .[0].code == 0' "$work/reply" >/dev/null; then
      echo "HEC did not accept the event (HTTP $status). Checkpoint preserved." >&2
      exit 1
    fi
  done < "$work/events"

  jq -r .next_cursor "$work/page" > "$work/next"
  mv -f "$work/next" audit.cursor
  if jq -e '.has_more == false' "$work/page" >/dev/null; then
    sleep "$poll"
  fi
done

CMP reads use bounded retries for transient HTTP failures, including 429 and 503. Keep the collector's error output for coverage-gap reports. A failed request or partial HEC delivery leaves the prior checkpoint in place. Resolve persistent errors and restart with backoff. Events accepted before a failure can repeat with the same stable ID. An empty page still advances the checkpoint. HEC response codes

Handle collection errors

SituationResponse
CMP 400Correct the query or cursor.
CMP 401 / 403Check the PAT, user's current eligibility, and direct-role audit permission.
CMP 429Honor Retry-After. Starting budgets are 60 requests/minute per account and 30 per principal.
CMP 503 or a network interruptionRetry with backoff using the saved checkpoint. Honor Retry-After when present.
CMP 410Record the gap and choose a new since using the returned coverage boundaries.
Nonempty coverage_gapsRecord the possible intervals for investigation. These intervals do not identify exact missing events.
HEC failure after part of a pageKeep the previous checkpoint and retry; already-accepted events can be duplicated.

CMP exposes 45 days from capture and does not backfill activity from before rollout. An empty coverage_gaps array does not establish complete capture. On 410, record the request ID and the returned error.coverage_started_at and error.earliest_available_at. Choose a new fixed START_AT at or after the reported available boundary and within the current 45-day window. Record any history you could not recover. Archive the old audit.cursor under a different filename before restarting so the collector uses the chosen time.

Verify events and recovery in Splunk

Configure JSON field extraction for synaccess:cmp:audit. Search the index selected by your HEC token and choose a time range containing the test event's occurrence time:

sourcetype="synaccess:cmp:audit"
| spath
| dedup id
| table _time id type actor.id target.device_serial action outcome correlation_id

The dedup command removes repeated IDs from these search results; it does not prevent duplicate ingestion.

Before operational use:

  1. Generate an authorized test action and verify its event ID, user, device, timestamp, and outcome in Splunk.
  2. For an outlet command, find the request and result using their shared correlation_id. A PDU acknowledgment and confirmed execution have different meanings.
  3. Pause after a saved page, resume from its cursor, and verify the expected events remain searchable across the interruption.
  4. Test a destination failure and confirm that the checkpoint does not advance until the page passes the destination's acceptance checks.

The collector is tested against controlled CMP and HEC receivers, including partial acceptance, replay, and empty pages. Verify actual indexing, field extraction, and your deployment's acceptance requirements in Splunk.


Did this page help you?