> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cotool.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Normalize Custom Logs with OCSF

> Test and publish a versioned OCSF mapping, then replay quarantined events after fixing it.

Use [Open Cybersecurity Schema Framework](https://ocsf.io/) (OCSF) normalization when you want custom JSON events represented using a common event class and fields. Use a provider-specific format when the source offers one that matches your data, or **Generic JSON** to collect records without an OCSF mapping.

You can assign a published mapping to an [AWS S3/SQS](https://docs.cotool.ai/integrations/security-tools/siem/aws-s3-sqs.md), [GCP Pub/Sub](https://docs.cotool.ai/integrations/security-tools/siem/gcp-pubsub.md), or [Azure Blob Storage](https://docs.cotool.ai/integrations/security-tools/siem/azure-blob-storage.md) log source that offers the OCSF format. Working with configurations and quarantined records requires organization-wide **Manage Tools** (`tool.manage`).

## Create, test, and publish a mapping

**1. Start a new configuration**

In [Log Ingest](https://app.cotool.ai/platform/log-ingest), select **OCSF normalization** and then **New configuration**. Choose a name, OCSF version, and event class that match the data.

**2. Configure payload decoding**

Under **Settings > Input**, choose how to decode incoming payloads: **Detect JSON or NDJSON**, **JSON**, or **NDJSON**. If each JSON document wraps events in an array, set **Record array path** to that field, such as `Records` for `{"Records": [{"action": "sign_in"}]}`. Leave it blank for individual records or a top-level array of records.

**3. Map fields from a sample**

Under **Mapping**, paste a representative payload in **Sample input**. Use **Add field** to map source values to OCSF attributes, or select **Draft with AI** to suggest mappings. Review the suggestions against your source schema and use samples without secrets or real personal data.

**4. Check validation and save regression samples**

In **Result**, inspect **Output** for the expected values and **Checks** for missing required attributes, validation errors, and sample failures. In **Sample input**, select **Save** to keep regression samples. Include a representative record that should pass and, if useful, one that should fail, such as a record missing a required field.

**5. Publish the mapping**

Select **Publish** after checking your results. Draft changes do not affect ingestion. To publish from the editor, the current draft must be tested: fix incomplete field rows and blocking checks, confirm that saved samples match their expected results, and make sure the test payload decodes and produces at least one valid event.

## Assign the mapping to a source

Open the log source in **Integrations**, set its **Format** to **Custom format, normalized to OCSF**, and select the published configuration. Review the source preview, then verify a known event in [Log Search](https://docs.cotool.ai/log-ingest/search.md) using its event time and an expected mapped field.

> [!NOTE]
>
> Publishing a new version changes how every source using that configuration
> handles newly accepted work. If the new mapping is wrong, open **Versions**
> and choose **Activate** beside an earlier version. Neither publishing nor
> rolling back reprocesses events already indexed or replays quarantined
> records.

## Fix and replay quarantined records

**1. Inspect failing records**

Open the source's **Failures** tab. Select a group to narrow the records
by the reported error and mapping version. Inspect the field that failed
and check whether the payload could be decoded as configured.

**2. Test a mapping fix**

Update the mapping and use **Test fix** with the draft or a published
version. This previews the change on matching quarantined records
without indexing them.

**3. Publish and replay affected records**

When the fix is ready, publish it and select that version in
**Failures**. Select **Replay affected records** and confirm the record
count. Replay queues only the quarantined records matching the current
filter; it does not reprocess the full source history.

**4. Verify recovered events**

Follow progress under **Replays**. Verify the recovered events in Log
Search and check any remaining failures. Quarantined records are kept
for 30 days, so investigate before the records expire.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.