sdl-log-parser
/sdl-log-parser
Use whenever the user wants to author, edit, debug, validate, or explain a SentinelOne Singularity Data Lake (SDL) log parser, the augmented-JSON files at /logParsers/ that extract fields from raw log text before ingestion. Trigger on "SDL parser", "Skylight parser", "log parser", "parser editor", "write a parser", "test parser", or any pasted raw log the user wants turned into structured fields. Also trigger on parser-DSL keywords like `formats:`, `patterns:`, `lineGroupers:`, `rewrites:`, `discardAttributes:`, `aliasTo:`, `{parse=...}`, `{regex=...}`. Especially trigger when the user pastes
- Author
- sentinel-one ↗
- Repository
- ai-siem ↗
- Licence
- AGPL-3.0
- Last repository change
- 26.10.2026
Assessment and security
- Files in this package
- 44
- Scripts
- 4
- HTML comments
- 1
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.
AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.
- 4 scripts in this package. Review them before installing, as Claude may execute them.
- SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.
Scripts: scripts/lint_parser.py, scripts/parser_rules.py, tests/test_lint_parser.py, tests/test_sdl_log_parser_skill_invariants.py
What it does and when to use it
Use whenever the user wants to author, edit, debug, validate, or explain a SentinelOne Singularity Data Lake (SDL) log parser, the augmented-JSON files at /logParsers/ that extract fields from raw log text before ingestion. Trigger on "SDL parser", "Skylight parser", "log parser", "parser editor", "write a parser", "test parser", or any pasted raw log the user wants turned into structured fields. Also trigger on parser-DSL keywords like `formats:`, `patterns:`, `lineGroupers:`, `rewrites:`, `discardAttributes:`, `aliasTo:`, `{parse=...}`, `{regex=...}`. Especially trigger when the user pastes
Triggers from the description
Original author description
Use whenever the user wants to author, edit, debug, validate, or explain a SentinelOne Singularity Data Lake (SDL) log parser, the augmented-JSON files at /logParsers/ that extract fields from raw log text before ingestion. Trigger on "SDL parser", "Skylight parser", "log parser", "parser editor", "write a parser", "test parser", or any pasted raw log the user wants turned into structured fields. Also trigger on parser-DSL keywords like `formats:`, `patterns:`, `lineGroupers:`, `rewrites:`, `discardAttributes:`, `aliasTo:`, `{parse=...}`, `{regex=...}`. Especially trigger when the user pastes
How it works
- Gate 0: can an SDL parser run on this source at all? (check this first)
- Two hard rules (every parser, every time)
- Critical pitfalls (read before authoring)
- When to use this skill
- Workflow
- Required default attributes on every parser (MANDATORY)
- Default output schema: OCSF (mandatory reference)
- Top-level parser structure
- Field-matcher syntax inside a format string
- Canonical reference parsers by input shape
SKILL.md preview
---
name: sdl-log-parser
author: Prithvi Moses <prithvi.moses@sentinelone.com>
description: Use whenever the user wants to author, edit, debug, validate, or explain a SentinelOne Singularity Data Lake (SDL) log parser, the augmented-JSON files at /logParsers/ that extract fields from raw log text before ingestion. Trigger on "SDL parser", "Skylight parser", "log parser", "parser editor", "write a parser", "test parser", or any pasted raw log the user wants turned into structured fields. Also trigger on parser-DSL keywords like `formats:`, `patterns:`, `lineGroupers:`, `rewrites:`, `discardAttributes:`, `aliasTo:`, `{parse=...}`, `{regex=...}`. Especially trigger when the user pastes a raw log (CEF, syslog, JSON, key=value, multi-line, CSV) and asks to extract fields, normalize timestamps, or drop noise. If the project is SDL/Singularity/Scalyr and the user says "parse this log", use this skill. Always validates end-to-end via putFile → HEC ingest (parser applied) → query. NOT for PowerQuery (use powerquery), NOT for plain ingest without a parser (use sdl-api).
---
# SentinelOne SDL Log Parser Authoring
<!-- CONFIG-FILE-ADDRESSING v1 -->
> **SDL config files: address by `udoId`, and do not trust a REST listing.**
> REST `listFiles` / `getFile` **cannot see** udoId-addressed `/dashboards/` files, so `getFile`
> returns `404` on a dashboard the console is displaying and the listing under-reports (measured on
> one tenant: REST 8, GraphQL 17, console 48 files). **If a listing disagrees with what the UI
> shows, the listing is wrong until proven otherwise**, change read path before concluding the
> object is missing or the token lacks scope. Use the GraphQL `configFiles` / `configFile` surface.
> A name-addressed `addConfigFile` to `/dashboards/` **creates a duplicate** instead of updating;
> address dashboards by `udoId` with `expectedVersion`. `content` is HJSON, not JSON. `S1-Scope`
> changes which files exist as far as the caller can tell.
> Full detail: [`sdl-api/references/config-file-graphql.md`](../sdl-api/references/config-file-graphql.md)
This skill turns raw log samples into deployed, validated SDL parser definitions. A parser is an *augmented-JSON* file at `/logParsers/<name>` on the SDL tenant that extracts fields from each ingested line. The parser editor and the `Test Parser` button in the console run the parser client-side in JavaScript; this skill mirrors that workflow programmatically and finishes by ingesting a sample through the deployed parser to confirm the actual ingest path works.
> **Deploy and validate through the `s1-secops-mcp` MCP tools.** `sdl_get_file` / `sdl_put_file` read and deploy the parser, `powerquery_run` validates on the live stream, and `hec_ingest` runs the synthetic-ingest fallback. The server runs on the user's machine, so it reaches `*.sentinelone.net` where the Cowork sandbox cannot, and it reads credentials from environment variables or the OS keychain. If the tools are missing, point the user to the s1-secops-mcp README (`s1-secops-mcp/README.md` in the s1-secops-skills source repo, `mcp/s1-secops-mcp/README.md` in ai-siem; not shipped inside the plugin).
## Gate 0: can an SDL parser run on this source at all? (check this first)
The SDL parser sees exactly **two** attributes on an event: `message` and `parser`. Every other attribute on the event is invisible to it. The value of the `parser` attribute names which parser to apply, and that parser is applied to the content of `message`. That one fact decides whether writing a parser is the right move, so settle it before you invest in authoring.
| What a sample event carries | What happens | So do this |
|---|---|---|
| **`parser` and `message` both present** | The SDL parser runs: the parser named by `parser` is applied to the content of `message` | Author or edit `/logParsers/<parser>`. Normal path, continue with this skill. |
| **`message` present, `parser` absent** | The SDL parser has no name to select, so nothing runs | Set a `parser` attribute on the event in Data Pipeline Management (DPM). Once DPM sets it, the SDL parser parses whatever is in `message` under that parser name. This is usually the cheapest fix and the default recommendation. |
| **Neither present** | The SDL parser cannot be used at all | Parse in DPM instead. Do not author an SDL parser. |
| **Logs already parsed in DPM** | Events arrive pre-parsed with their fields already promoted; no SDL parser is involved | Nothing to author here. Neither attribute needs to exist. |
**An SDL parser cannot reach fields that live outside `message`.** If the fields you want to transform are already promoted to top level on the event, an SDL parser is the wrong tool however it is written: it has no way to read them. That work belongs in DPM.
Determine which case a source is in by inspecting a sample event for the presence of `message` and `parser`. The PowerQuery probes for that, plus how to set the `parser` attribute from DPM, are in `references/parser-eligibility.md`.
## Two hard rules (every parser, every time)
These two rules apply to every parser you write or edit, regardless of source, regardless of whether you're starting from scratch or copying from the catalog. Violating either produces a non-conformant parser even if extraction works.
**Rule 1: The 4 mandatory attributes are always present.**
```js
attributes: {
"dataSource.category": "security", // hardcoded constant, never any other value
"dataSource.name": "Corelight", // specific product/service name
"dataSource.vendor": "Corelight", // parent vendor / company name
"metadata.version": "1.0.0" // semver; bump on substantive parser changes
}
```
`dataSource.category` is fixed at `"security"`. Not `application`, not `network`, not `system`, not `audit`. The catalog has parsers that violate this; you do not.
`metadata.version` is mandatory and follows semver (`MAJOR.MINOR.PATCH`, with optional pre-release suffix like `-rc1` or `-beta1`). **Increment it on every build.** Patch bump for fixes, minor for additive changes, major for breaking schema changes. It can also be set inside `mappings` via a `constant` op when the source itself carries a vendor schema version you'd rather propagate per-event:
```js
{ constant: { field: "metadata.version", value: "<your-current-version>" } }
```
A `constant` in `mappings` overrides the parser-root `attributes:` value when it fires, which is useful when one parser handles multiple vendor schema versions and you want each event tagged with the right one.
**Rule 2: Every OCSF field name comes from `references/ocsf-schema-documentation.md`.**
Before emitting any OCSF dotted path (`src_endpoint.ip`, `actor.user.name`, `metadata.product.vendor_name`, etc.), grep `references/ocsf-schema-documentation.md` for the exact string. Do not invent field names. Do not copy from a catalog parser without verifying. Do not rely on memory. The reference is the single source of truth for the ~25,759 documented OCSF field names across the 7 categories.
The rest of this skill assumes both rules are upheld. If either is unclear for a given parser, stop and resolve before continuing.
## Critical pitfalls (read before authoring)
These are the DSL traps that cost the most iteration cycles when authoring parsers on the current S1 tenant. They are repeated in the long gotcha list below with more context, but if you're about to write a new parser, internalize these first. Items 1-9 are tenant-validated as of 2026-05-26; items 10-12 as of 2026-06-22.
1. **Key=value catch-all REQUIRES leading `.*`**. The canonical form is `".*$_=identifier$=$_=quoteOrSpace$"` with `repeat: true`. Without the `.*` the format anchors at position 0 of the message and fires zero times on any line starting with a syslog priority `<NNN>`, a CEF header, an XML envelope, or a timestamp, i.e. virtually every real log source. The leading `.*` lets the engine scan forward to the first `key=value` pair and then `repeat: true` walks the rest. This is the same pattern the built-in `keyValue` parser uses. Also: **`{parse=keyValue}` is NOT a valid sub-parser directive**; built-in parsers like `keyValue` are only usable via root-level `aliasTo:`.
2. **v1 mappings are FIRST-MATCH-WINS**, which means **renames must be duplicated into every per-subtype block** alongside the constants. A catch-all `predicate: "true"` rename block placed at the end NEVER fires for events that matched an earlier per-subtype block, only the truly-unmatched events get those renames. If you have per-subtype `constant` blocks for OCSF class/activity fan-out (e.g. `subtype=='forward'` → `activity_id=6`), you must put the full rename list inside EACH of those blocks. Verbose but correct.
3. **v0 constants take `field`, not `output`.** A v0 `constants:` entry keyed `output` (the key v0 `renames:` and `copies:` use) is rejected by `putFile` ("Expected a field", surfaced by the MCP as "Content is invalid json"). Keyed `field` (`{ field: "class_uid", value: 4001, type: "int" }`) it deploys and applies, which is the shape every marketplace v0 parser uses. Live-validated 2026-10-13; this corrects an earlier note that all v0 `constants:` were rejected. For new parsers prefer **v1** (`{ constant: { field, value } }`) anyway.
4. **Same-name v1 rename silently NULLS the field** (a same-name v0 `renames` entry keeps the value, live-validated 2026-10-13). Writing `{ rename: { from: "action", to: "action" } }` to "keep" a captured raw field under its own name actually deletes the value. The KV catch-all already extracts raw vendor field names directly into the event, to "keep" one, OMIT the rename. Only write a rename when the target name is genuinely different from the source.
5. **Unquoted numerics from `quoteOrSpace` are auto-typed as NUMBER columns.** A FortiGate `srcport=44321 sentbyte=8421` line going through the KV catch-all produces `srcport: 44321` (number), `sentbyte: 8421` (number), queryable with `avg()` / `sum()` / `> N` without `number()` wrapping. Quoted values stay as strings even if they look numeric (`level="6"` → string). Caveat: SDL column type-locking still applies, so wrap numerics with `number()` in dashboard panels and STAR rule bodies if the column has ever been written as string in this tenant's history.
Two related queryability rules (not DSL traps, but they matter for any consumer of the parser):
1. **The raw `message` field is preserved on every event regardless of parser activity.** SDL never lets a parser overwrite `message`; the raw event body always survives. So `parse "field=$x$" from message` queries continue to work alongside the typed columns the parser produces. This is the backward-compat escape hatch during a parser rollout.
2. **When two ingest paths produce OCSF for the same source, the schema can drift.** A common case: upstream collector (Observo etc.) flattens `type=traffic, subtype=forward` to just `event.type='forward'` while the downstream parser keeps both fields populated. Consumers (dashboards, STAR rules, hunts) should write subtype filters as `(event.subtype='forward' OR event.type='forward')` until the rollout fully converges.
3. **Trailing `.*` at the END of a format string suffers the leading-`.*`-strip too.** A field marker like `$process.cmd_line{regex=.*}$` placed at the end of a format string captures the EMPTY STRING. The SDL stripping rule applies whether `.*` starts the regex or IS the entire regex. Use `[\\s\\S]+` (one-or-more) or `[\\s\\S]*` (zero-or-more) for "everything that remains on the line" semantics; those forms don't begin with `.` and survive intact.
4. **Regex alternation matches in DECLARATION ORDER, not longest-leftmost.** `regex=CRON|CROND` is a bug, `CRON` matches the prefix of `CROND` and leaves `D` dangling. Put longer alternatives first: `regex=CROND|CRON|crond|cron`. Applies to named patterns, inline `{regex=...}`, and any other alternation. When alternatives share a prefix, sort by length descending.
5. **gron expands arrays into `[N]`-indexed attributes; index with `[N]`, NOT `.N.`** Do not believe "gron drops arrays." `$unmapped.{parse=gron}$` emits one queryable attribute per array leaf: `unmapped.signInEventTypes[0]`, `unmapped.additionalDetails[0].key`, `unmapped.targetResources[0].modifiedProperties[0].newValue`. The trap that makes arrays look dropped is querying with dot-index (`unmapped.targetResources.0.id` → null); the real key is bracket-indexed (`unmapped.targetResources[0].id`). gron/dottedJson = each element its own attribute (use for "extract every field"); `strict*` = array kept as one JSON value for `array_from_json()`. Scalar/object flattening is identical across all three. Caveat: a raw PowerQuery `columns`/`filter` clause can't type the `[`, so validate `[N]` fields with `powerquery_schema_discover`, not a `columns` projection. To lift a whole array subtree to OCSF, `rename_tree { from: "unmapped.targetResources[0].modifiedProperties", to: "entity.data" }`. Tenant-validated 2026-06-22 (Microsoft Entra ID). See `references/parse-directives.md`.
6. **`copy` first-of-N treats an empty string `""` as "exists" and lets it win.** `copy {from: ["userId","servicePrincipalId"]}` where `userId` is `""` copies the empty string, not the fallback, silently breaking identity-coalesce (e.g. service-principal / managed-identity sign-ins whose `userPrincipalName`/`userId` are empty but `servicePrincipalName`/`servicePrincipalId` hold the identity). Fix by dropping empty strings upstream (the collector/Lua serializer should omit `""` values), or `drop` the empty source before the `copy`. Tenant-validated 2026-06-22.
7. **On a LIVE source, a "still broken" event is usually pre-propagation, not a parser bug.** Parser activation is ~3-5 min and a continuously-ingesting source keeps producing events through the OLD version during that window; SDL never re-parses historical events. Bump `metadata.version` every deploy and confirm via `| group count() by metadata.version` (or `powerquery_schema_discover`) which version parsed a given event before chasing a "bug." Related: if the parser sets event time from a log field, events are stamped at the log's own time, so widen validation query windows (`24h`/`7d`) or filter by a nonce field instead of time, or you get zero rows and a false negative.
## When to use this skill
Use this skill when the user wants to turn raw log text into structured SDL events. Common triggers:
- "Write a parser for this `<vendor>` log."
- "Why isn't `<field>` showing up after ingest?"
- A pasted log line: CEF, syslog, JSON-per-line, key=value, multi-line, vendor-specific.
- Edits to an existing parser ("add a rewrite that masks the password", "tag every event with `dataset=fortinet`").
- Migration ("alias the new parser to the old one").
Do **not** use this skill for PowerQuery authoring (use `powerquery`) or for plain-text ingestion that does not need a parser (use `sdl-api` directly).
## Workflow
Follow this loop. Skipping steps 1 (catalog check) and 5 (end-to-end validation) are the two most common reasons a parser goes live with surprises, so do not skip them.
0. **Clear Gate 0 before anything else.** Confirm the source's events carry both `message` and `parser`, so an SDL parser can actually run on them. If `parser` is absent, the fix is a DPM-set `parser` attribute, not a parser file. If neither attribute is present, parsing belongs in DPM and there is nothing to author here. See *Gate 0* above and `references/parser-eligibility.md`.
1. **Check the ai-siem catalog first.** Before writing anything, search <https://github.com/Sentinel-One/ai-siem/tree/main/parsers> for the vendor/product. The repo has ~150 community + marketplace parsers; most common sources (Cloudflare, FortiGate, Palo Alto, Corelight, AWS RDS, Okta, Abnormal, Juniper, pfSense, Cisco ASA, etc.) are already there. If a parser exists, download it and diff against the user's requirements, far less work than authoring from scratch. See `references/ai-siem-catalog.md` for the recipe and a map of template parsers by shape.
2. **Inspect the sample.** Read every line the user pasted. Look for: leading priority/timestamp/host (syslog framing), the body shape (CEF | JSON | key=value | positional CSV | freeform), any obvious sub-structures (`uri=...`, embedded JSON, base64), and whether multiple physical lines belong to one logical event (stack traces, MySQL slow queries, Postgres SQL).
3. **Decide on strategy.** See *Strategy decision tree* below. Most logs are one of: alias an existing built-in, single line format with `$field$` markers, repeating key/value catch-all, JSON parser with `discardAttributes`, line-grouper for multi-line, or a mapper for OCSF-style restructuring.
4. **Draft the parser.** Use the templates in `examples/` as starting points, or (from step 1) a catalog parser as a base. Always start minimal, extract the *outer* frame first (timestamp + host + body), then add fragment formats or `{parse=...}` directives to crack the body open.
4a. **Lint offline before you deploy.** Run `python3 scripts/lint_parser.py --new <parser-file>` (standard library only, no tenant, no credentials). It checks the parser against the known traps in this file (key=value catch-all without its leading `.*` or `repeat: true`, a v0 constant keyed `output`, `severity` plus `severity_id`, same-name v1 renames, a catch-all mapping that is not last, stripped `.*` at either end of a regex, an anchorless lazy prefix, alternation order, root-only scratch discards, escaped dots, the mandatory attributes, `claude_test_*` names, and four shapes `putFile` rejects outright: a transformation entry with a second key such as `_comment`, an unsupported op such as `regex`, a `{name=...}` matcher option, and `[]` in a predicate; each rule was validated on a live tenant) and exits non-zero on any ERROR. Fix every ERROR before `sdl_put_file`. `--rules` lists the rules with the section each comes from. A clean lint means none of the KNOWN traps are present; it does not prove the parser parses, so step 5 is still the definition of done. Drop `--new` to audit an inherited catalog parser, where the hard rules report as findings instead of errors.
5. **Deploy in place and validate on the live stream (DEFAULT).** Update the SAME parser name the source already uses (`/logParsers/<name>`) via `sdl_put_file` with the current `expectedVersion` from `sdl_get_file`, bumping `metadata.version` on every deploy. Then validate against events the source is already sending: after ~3-5 min propagation, query `dataSource.name='<Name>' metadata.version='<new>'` and confirm the expected fields are populated and not null. Do NOT stand up a `claude_test_*` parser and do NOT synthetically HEC-ingest samples when the source is live, saved parser edits are non-destructive (they apply only to newly ingested events and never re-parse history), so editing the real parser is safe and the live feed is the authoritative test. The synthetic-ingest recipe in *Validation* is a FALLBACK, only for a source that is not currently ingesting. Before you deploy, commit the current live definition as a baseline, and after you deploy commit the new version, both to git in the **local project folder only** (see *Validation → Version control & rollback*). See *Validation* below. **Do not call this skill done before the live query shows the fields populated.**
6. **Iterate.** If a field is missing or wrong, identify which format/rewrite/mapping was responsible, edit, bump `metadata.version`, redeploy the same parser, wait for propagation, and re-query the live stream filtering on the new `metadata.version`. (Only for a non-live source: re-ingest the sample with a fresh nonce.)
7. **Hand off.** Show the user the final parser file (path + version), the sample they gave, and the parsed fields the query returned.
## Required default attributes on every parser (MANDATORY)
**Four attributes are MANDATORY on the top-level `attributes:` block of every parser**, regardless of source. These are non-negotiable:
```js
"dataSource.category": "security", // ALWAYS hardcoded to "security": fixed constant, never change
"dataSource.name": "Corelight", // specific product/service name (example value)
"dataSource.vendor": "Corelight", // parent vendor / company name (example value)
"metadata.version": "1.0.0" // semver; required on every parser
```
These four are required by the downstream SDL pipeline (Marketplace routing, parser catalog, content-pack grouping). Omitting any of them produces a non-conformant parser even when field extraction is correct.
**`dataSource.category` MUST always be hardcoded to `"security"`.** This is not a taxonomy pick, it is a fixed constant. Never substitute another value (`application`, `network`, `system`, `audit`) regardless of the source type. Empirical audit of the ai-siem catalog (2026-04) shows ~17% of community parsers violate this rule with values like `application`, `network`, `system`, `audit`. Fix on copy.
`dataSource.vendor` is the parent company (`Cisco` for Umbrella, `Microsoft` for Azure AD). `dataSource.name` is the specific product (`Cisco Umbrella`, `Azure AD`). For single-product vendors both can be the same string (`Corelight` / `Corelight`).
`metadata.version` is semver (`MAJOR.MINOR.PATCH` with optional `-rcN` / `-betaN` suffix). **Always increment on a new build** so content-pack tooling can detect drift. Patch for fixes, minor for additive changes, major for breaking schema changes. May also be emitted from inside `mappings` via:
```js
{ constant: { field: "metadata.version", value: "<your-current-version>" } }
```
A `mappings.constant` overrides the parser-root `attributes:` value when its predicate fires. This is the right pattern when one parser handles multiple vendor schema versions and you want each event labeled with the schema-version it actually came from.
**Catalog-parser audit step.** When you start from a catalog parser, the very first edits you make are to confirm all four fields are present, that `dataSource.category` is `"security"`, and that `metadata.version` exists and reflects the change you're about to make. About 1/3 of the community parsers in `Sentinel-One/ai-siem` are missing `dataSource.category` outright; many that include it use a non-security value. Fix before doing anything else.
## Default output schema: OCSF (mandatory reference)
Unless the user explicitly asks for vendor-native names, **emit OCSF-shaped events**: name captured fields with their OCSF dotted paths and tag every event with the class metadata (`class_uid`, `class_name`, `category_uid`, `category_name`, `metadata.product.*`, plus per-subtype `activity_id` on the format). OCSF is the mandatory default output schema for this skill.
**OCSF mapping MUST always be done using `references/ocsf-schema-documentation.md`**, the authoritative catalog (7 categories, ~25,759 field entries). Grep it for the exact dotted path before emitting any OCSF field name; never invent a name, never trust memory or a catalog parser. `references/ocsf-mapping.md` holds the OCSF class quick-picker (4001/4002/3002/1001, etc.), the field-to-dotted-path tables, and the two authoring idioms (capture-directly-into-dotted vs capture-vendor-native-then-rename). Consult both before writing any mapping.
## Top-level parser structure
A parser file is augmented JSON (unquoted keys allowed, `//` and `/* */` comments allowed). Top-level keys:
```js
{
timezone: "UTC", // fallback for timestamp parsing
attributes: {
// REQUIRED defaults on every parser
"metadata.version": "1.0.0",
"dataSource.category": "security", // always "security", hardcoded, never change
"dataSource.name": "Juniper SRX",
"dataSource.vendor": "Juniper",
// OCSF class metadata + vendor product metadata
"metadata.product.vendor_name": "Juniper",
"metadata.product.name": "SRX",
"metadata.log_provider": "rt_flow",
"class_uid": 4001,
"class_name": "Network Activity",
"category_uid": 4,
"category_name": "Network Activity"
},
patterns: { tsPattern: "\\w+\\s+\\d+\\s+[0-9:]+" }, // named regex shortcuts
lineGroupers: [ { start: "...", continueThrough: "..." } ], // multi-line glue
formats: [
{
id: "happy-path",
attributes: { activity_id: 1, activity_name: "Open" }, // per-subtype tagging
format: "$time=tsPattern$ $src_endpoint.hostname$ $body$",
discard: false,
halt: true, // stop after first match
repeat: false // re-apply until no progress
}
],
// Advanced (not always present):
mappings: { mappings: [ /* rename vendor-native fields to OCSF dotted names */ ] }
}
```
`formats` is the primary engine. Everything else either feeds into it (patterns, lineGroupers) or runs after it (rewrites, mappings, discardAttributes).
## Field-matcher syntax inside a format string
```bash
$fieldName=patternName{parse=...}{regex=...}{attrWhitelist=...}{attrBlacklist=...}{timezone=...}$
```
Rules that bite people often:
- `$field$` alone uses the `quotable` pattern by default, which stops at whitespace or quote boundaries.
- `$field{regex=\\d+}$` inlines a regex: backslash metacharacters double-escape (`\\d` not `\d`).
- Two adjacent `$a$$b$` with no delimiter between them require a pattern or regex on `$a$` so it knows when to stop.
- `message` is reserved: it's the raw event text. You cannot capture into `message` from a format. You *can* `discardAttributes: ["message"]` to drop it.
- A literal `$` in the log requires `\$$` (escape the dollar, then close the field).
- Any space in the format matches `\s+`. To match a single literal space use `\\` (backslash-space).
For the full directive list see `references/syntax.md` and `references/parse-directives.md`.
## Canonical reference parsers by input shape
Moved to a reference to keep SKILL.md under the 500-line limit. See [`references/canonical-parsers.md`](references/canonical-parsers.md).
## Strategy decision tree
Clear *Gate 0* first: if the events do not carry both `message` and `parser`, no strategy below can run and the answer is DPM. Then apply the tree in order; first match wins:
1. **Is there a parser in the ai-siem catalog?** Search `Sentinel-One/ai-siem` for the vendor/product name. If so, start from that parser (see `references/ai-siem-catalog.md` for the fetch recipe and per-shape template map). On copy, immediately audit and fix:
- The **4 mandatory attributes** (`dataSource.category` hardcoded to `"security"`, `dataSource.name`, `dataSource.vendor`, `metadata.version`). About 1/3 of community parsers miss `dataSource.category` outright; many that include it use `application`/`network`/`system`/`audit` instead of `"security"`. Force them to `"security"`. Add `metadata.version` if missing, bump it if you're changing the parser.
- All OCSF field names against `references/ocsf-schema-documentation.md`. Catalog parsers frequently use vendor-native names (`source_ip`, `dst_port`) where OCSF dotted paths (`src_endpoint.ip`, `dst_endpoint.port`) are required. Rewrite via `mappings.rename` or change the capture name directly.
- Stale tenant-specific attributes (e.g. hardcoded `site.id`).
- `class_uid` should be an integer, not a string.
- Bump `metadata.version`.
2. **Is there a built-in parser?** Web access logs → `accessLog`. Pure JSON-per-line → `json` or `dottedJson`. Syslog → `systemLog`. Key=value pairs → `keyValue`. Heroku logplex → `heroku-logplex`. MySQL/Postgres → their dedicated parsers. CloudFront/ELB/S3/Redshift → AWS parsers. See `references/builtin-parsers.md`. If a built-in fits, recommend it and (optionally) just author an alias parser: `{ aliasTo: "json" }`.
3. **Is the log JSON-per-line but with a vendor envelope?** Use one format that captures the envelope and applies `{parse=json}` (or `dottedJson`/`escapedJson`/`urlEncodedJson`/`base64EncodedJson`) on the embedded body. Add `discardAttributes: ["message"]` to save storage.
4. **Is the whole line an OCSF/JSON blob you want flattened?** Use the gron-capture-then-mappings idiom: `format: "$unmapped.{parse=gron}$"` at the top, then rename/copy/cast everything in a `mappings` block. See `examples/08-gron-capture-template.json` and the `community/PARSER_TEMPLATE/` reference.
5. **Is the body a sequence of `key=value` pairs?** Use the two-format key/value idiom. The repeating catch-all format MUST be exactly `".*$_=identifier$=$_=quoteOrSpace$"` (with the leading `.*`) and have `repeat: true`. Without the `.*` the format only anchors at position 0 of the message and fires zero times on any line that starts with a syslog priority `<NNN>`, a CEF header, an XML envelope, or anything else that isn't bare `identifier=`. The `_` field name means "use the captured token as the field name". `{parse=keyValue}` is NOT a valid sub-parser directive; it returns `Unknown parser "keyValue"`. The `keyValue` built-in can only be referenced via `aliasTo: "keyValue"` at the parser root (one-line alias parser), not via `{parse=...}`. Canonical references: built-in `keyValue` parser; `examples/03-key-value.json`; `sentinelone/marketplace-fortinetfortigate-latest/` (FortiGate syslog, key=value with quoted strings).
6. **Is it CEF or LEEF?** Treat the header as a positional pipe-delimited line, then apply key/value catch-all to the extension. See `examples/01-cef-over-syslog.json`.
7. **Is it positional / CSV / TSV?** Use `commaSeparatedValues` / `commaSeparatedvalues` or `pipeSeparatedValues` parse directives with `skipNumericConversion: true`, and name the columns in a `mappings` block by positional index (`attr[N]`). Palo Alto Networks Firewall in ai-siem is the canonical reference.
8. **Does the source emit multiple distinct event shapes** (e.g. MySQL error vs MySQL general vs Postgres from one RDS stream)? Give each `format` an `id:` and fan mapping entries out with `predicate: "<id>='true'"`. See the AWS RDS marketplace parser.
9. **Are events multi-line?** Add a `lineGroupers` block with `start` + one of `continueThrough` / `continuePast` / `haltBefore` / `haltWith`. Then write formats against the joined event. **Beware** HEC ingest newline splitting (see ingest-path gotchas). Canonical multi-line examples: `parsers/community/sql_database_logs-latest/` (Postgres SQL) and `parsers/sentinelone/marketplace-awsrdslogs-latest/` (RDS mysql/postgres mixed stream).
10. **Is the source Windows Event Log XML?** Use the per-EventID sub-parser idiom from `parsers/community/microsoft_windows_eventlog-latest/`: a `lineGroupers` block joins multi-line XML, then one format per EventID (4624, 4625, 4720, 4728, 1102, etc.) extracts EventID-specific fields. Remember the `\\t` / `\\n` double-escape gotcha. Class fan-out: 4624/4625 → `class_uid: 3002` Authentication, 4720/4728 → `class_uid: 3001` Account Change, 1102 → `class_uid: 6004` Web Resources Activity (or whatever fits).
11. **Do you need to restructure to OCSF or another schema?** Use `mappings` (gron-style mappers). See `references/mappers.md` for the two equivalent syntaxes (v1 singular / v0 marketplace). For new parsers prefer v1; only stay on v0 when extending an existing v0 parser. **Always look up dotted paths in `references/ocsf-schema-documentation.md` before emitting them.**
12. **None of the above?** Hand-write a line format. Look for stable delimiters and use named patterns when delimiters are insufficient (e.g., a timestamp containing spaces). Drop events you never want (`discard: true` on the format) rather than letting them fall through to a looser format.
## Common gotchas (memorize)
- **Double-escape every regex metacharacter.** `\\d`, `\\s`, `\\.`, `\\\\`. The augmented-JSON layer eats one backslash before the regex engine sees it.
- **`severity` is a RESERVED field coerced to 0-6 integer.** The ingest pipeline maps `info`/`warn`/`error` strings to 0-6 using its own vocabulary. OCSF labels like `"Informational"` / `"Medium"` collide and get rewritten. For the OCSF string, emit `severity_name` (or any non-colliding name); for the integer, emit `severity_id` directly (int; the 0-6 range is validated, 99 "Other" is unvalidated). Never emit both `severity` and `severity_id` from the same parser. Tenant-validated April 2026.
- **gron-captured dotted keys are FLAT, not nested.** A source JSON key like `"user.email": "alice"` becomes `unmapped.user.email` as a single flat field, mappings must reference it with `from: "unmapped.user.email"` (no escaping). `from: "unmapped.user\\.email"` does NOT match on current tenants (re-confirmed live 2026-10-13; lint rule R13).
- **Saved parsers apply only to newly ingested events.** Historical logs are not re-parsed. So during iteration you must re-ingest the sample after every parser edit.
- **A `parser=<name>`-tagged source with NO `/logParsers/<name>` file ingests raw (passthrough).** If events carry `parser='auditd'` but `dataSource.name` / `class_uid` are null, the named parser file does not exist yet: the collector tags the events but SDL has nothing to apply. Deploy `/logParsers/<name>` and NEW events get parsed. After deploy, the parser's root `attributes` (e.g. `dataSource.name`) are the canary that the parser is RUNNING AT ALL, if they are still null on fresh events the parser has not propagated yet (not a format bug); if they are populated but a captured field is null, that IS a format/mapping bug. `metadata.version` is the canary for WHICH version is live: bump it on every deploy so you can tell from the live stream when a specific change has propagated (poll `| group c=count() by metadata.version` until the new version appears). Propagation observed at ~3-5 min on this tenant. Tenant-validated 2026-06-01.
- **`halt: true` stops the format engine after a match.** Use it for mutually exclusive formats (e.g., TCP vs UDP variants in pfSense). Without it, all matching formats merge their captures.
- **`repeat: true` reapplies the same format from where it left off.** Required for the key/value catch-all idiom, otherwise only the first pair is captured.
- **`discardAttributes` MUST be per-format for scratch fields, NOT parser-root.** A `discardAttributes: [...]` block at the parser root does NOT reliably drop fields created by named captures inside a format string (`$_xxx{regex=...}$` scratch markers leak through to the event). Put `discardAttributes: ["_pre", "_tail", ...]` ON THE FORMAT OBJECT itself, alongside `format:`. The built-in `json` parser shows the shape: `formats: [ { format: "$json{parse=json}$", repeat: true, discardAttributes: ["message"] } ]`. Parser-root scope only works for fields produced by `{parse=json}` / `{parse=dottedJson}` flat expansion (vendor noise keys like `flipkart_not_secure`), not for format captures. Tenant-validated 2026-05-13.
- **There is NO `from:` directive on a `format` entry.** Only `id`, `attributes`, `format`, `discard`, `halt`, `repeat`, and `rewrites` are honored. A `from: "<somefield>"` next to `format:` is silently ignored, and the format then runs against the raw line; a greedy regex like `[\s\S]+` will clobber every targeted field with the entire log message on every event. The `from:` key only exists in `mappings` ops (`{rename: {from, to}}`, `{copy: {from, to}}`). To run a format-like rewrite against a specific captured field, use `rewrites:` on the same format with `input: "<fieldname>"`, or do the work in a `mappings` op.
- **The parser sees only `message` and `parser`.** `parser` selects which parser runs; `message` is the content it runs against (see *Gate 0*). Every other attribute is invisible to it. Ingest-time attributes (`app_id`, `cluster`, `region`, custom enrichments from collectors / HEC ingest) are NOT visible to format strings, format-level `discard:` filters, or `rewrites` regex inputs. Those ingest-time attributes ARE visible to `mappings` predicates and `mappings` op `from:` paths since mappings run after parsing. Fields already promoted to top level by an upstream pipeline are unreachable from a format for the same reason, so transform those in DPM. Encode any sentinel you need to gate a format on into the message body or anchor on a string the message itself contains.
- **v1 `mappings` is FIRST-MATCH-WINS.** Mapping entries are tried in declaration order; only the first entry whose `predicate` matches an event runs. A `predicate: "true"` catch-all therefore MUST go LAST in the list, placed first, it shadows every per-app/per-class entry below it (renames don't apply, class constants stay generic). Pattern: most specific predicates first, generic catch-all last. If two predicates would both fire on the same event and you want both effects, fold their transformations into a single entry. Tenant-validated April 2026.
- **Fragment-format anchors must live INSIDE the prefix's regex, not as separate format-string text.** The format `$_pre{regex=[\s\S]*}$/actuator/health$_suf{regex=[\s\S]*}$` (greedy `[\s\S]*` followed by literal text in the format string between the field markers) does NOT match, the engine commits each field's regex independently and won't backtrack across literal-text gaps. Working form: `$_pre{regex=[\s\S]*\/actuator\/health}$$_suf{regex=[\s\S]*}$` (literal anchor inside the prefix's regex). Same shape as Phase-10 IOC formats (`[\s\S]*X-Forwarded-For=[\[]?` baked into the prefix).
- **Greedy `[\s\S]*ANCHOR` lands on the LAST occurrence of `ANCHOR`.** That is the right behaviour when the captured token follows the rightmost anchor on the line (Dropwizard `[\s\S]*\[dw-[0-9]+ -` is unique to the request-line bracket). It fails when the anchor is too generic: `[\s\S]*\[` followed by a `UT-[0-9]+` capture fails on any line whose last `[` is something else (e.g. `[#033[36m...]` ANSI brackets). Two fixes: (a) make the anchor multi-character and discriminating (`[\s\S]*\[UT-`), accepting that the literal is consumed by the anchor and your capture holds only the trailing portion (`$user_task_id_num{regex=[0-9]+}$`); or (b) use a lazy quantifier (`[\s\S]*?`) plus a discriminating literal when the FIRST occurrence is the right one.
- **Greedy `[\\s\\S]*<anchor>` collides with COMPOUND field names that contain the anchor as a substring.** Anchoring a record-type capture on bare `type=` (`$_pre{regex=[\\s\\S]*type=}$$rectype{regex=[A-Z0-9_]+}$`) silently mis-fires on auditd PATH records because `nametype=NORMAL` (and `objtype=`) contain `type=`, the greedy match lands on the LAST `type=` (the one inside `nametype=`), captures `NORMAL`, and the rest of the format then fails. Fix: widen the anchor with the delimiter that precedes the REAL token, e.g. `type=` with a leading space (`$_pre{regex=[\\s\\S]* type=}$`), since the real record-type follows a space (`audispd: type=PATH`) whereas `nametype=`/`objtype=` are preceded by a letter. General rule: when your anchor is a short substring that also appears inside longer field names, disambiguate it with a neighbouring delimiter. Tenant-validated 2026-06-01 on a Linux auditd parser: bare `type=` parsed SYSCALL/EXECVE/PROCTITLE but dropped every PATH record; `type=` fixed all record types.
- **Per-event parse limit is just under 50,000 chars.** Long events get truncated *before* parsing.
- **Line groupers max 100,000 chars per joined event.** Above that, the grouper still emits but truncated.
- **`intermittentTimestamps: true`** is required for logs (like MySQL general query log) that emit a timestamp only on the second they roll over. Without it, every line missing a timestamp gets the ingest time.
- **Regex alternation cannot wrap a `$...$` token.** `($a$|$b$)` is invalid. Use multiple line fragments instead.
- **SDL regex engine does NOT support lookarounds.** `(?=...)`, `(?!...)`, `(?<=...)`, `(?<!...)` all fail silently. Use explicit token delimiters or split into multiple formats.
- **SDL strips the leading `.*` from a regex before passing it to the Java engine.** This means using `.*?` (non-greedy) at the start of a regex produces an orphaned `?` which the engine rejects as "Dangling meta character '?' near index 0". Use plain `.*` and rely on normal greedy matching. If you need non-greedy behaviour, restructure the capture into two segments (see below).
- **Trailing `.*` at the END of a format string is also stripped (same root cause as leading `.*`).** A format ending in `$_body{regex=.*}$` or `$process.cmd_line{regex=.*}$` (the field marker is the last thing on the line, regex is exactly `.*`) silently captures the EMPTY STRING instead of "everything to end of line". The SDL leading-`.*`-strip rule applies regardless of whether the `.*` is the entire regex or merely starts it; with the `.*` stripped, the regex becomes empty and the field defaults to a zero-length capture. Tenant-validated 2026-05-26 on a linuxLogsParser sudo format: `COMMAND=$process.cmd_line{regex=.*}$` captured `""` (empty), whereas the same format with `regex=[\\s\\S]+` captured the full command-line including embedded spaces. Use `[\\s\\S]+` (one or more, including newlines) or `[\\s\\S]*` (zero or more, including newlines) at any field marker where you want "everything that remains on the line" semantics. Both forms avoid the leading-`.*` strip and survive intact.
- **Regex alternation matches in DECLARATION ORDER, not longest-leftmost.** `regex=CRON|CROND` is a bug: `CRON` is tried first and matches the literal prefix of `CROND`, leaving `D` to fail against the next literal in the format string. The fix is to put the LONGER alternative FIRST: `regex=CROND|CRON|crond|cron`. This applies anywhere alternation appears (named patterns, inline `{regex=...}`, regex in rewrites). Tenant-validated 2026-05-26: linuxLogsParser cron_cmd format with `CRON|CROND` matched zero CROND events; same format with `CROND|CRON` matched every cron variant. General rule: when alternatives share a prefix, sort by length descending.
- **`[\s\S]*?` (lazy) at the start of a prefix regex silently matches almost nothing, same family of bugs as `.*?`, but no error.** A fragment format like `$_pre{regex=[\s\S]*?}$$field{regex=PATTERN}$$_suf{regex=[\s\S]*}$` will fire on a tiny fraction of events instead of the expected matches, because the SDL regex engine does not backtrack across field boundaries when the prefix is lazy. The fix is the same shape as the multi-char-anchor rule: use greedy `[\s\S]*` plus a discriminating literal anchor inside the prefix regex itself (e.g. `[\s\S]*\"merchant_transaction_id\":\"` to anchor on a JSON key before capturing a CL transaction id). Tenant-validated 2026-05-13. If you actually need first-match semantics, anchor on a literal that only appears once per line (e.g. `\[log\.`, `\"url\":\"`), do not reach for `*?`. Live-validated 2026-10-13: the anchorless form (`$_pre{regex=[\s\S]*?}$`) makes the whole format fail to match, while a lazy prefix WITH a literal anchor inside its own regex (`[\s\S]*?COMMAND=`) captures correctly.
- **When no format matches an event, the parser's root `attributes` are not applied either** (live-validated 2026-10-13 on three independent failure shapes). A null `dataSource.name` on fresh events therefore means "no format matched" as often as "the parser has not propagated": check one before assuming the other.
- **Two-segment sequential capture pattern for JSON values inside a raw string.** When a log line is a raw JSON string (with `\"` escaping) and you need to extract a field value, use a two-segment format with a `$$` transition. First segment grabs everything up to and including the opening quote of the value into a scratch field; second segment captures the value up to the closing quote. Example for extracting `severity_name` before SDL coerces it: `$_ps{regex=.*\\\"severity\\\":\\\"}$$severity_name{regex=[^\\\"]*}$`. The `$$` boundary: the first `$` closes seg 1, the second `$` opens seg 2. The scratch field (`_ps`) must be in the format's OWN `discardAttributes: ["_ps"]` array (per-format, alongside `format:`), parser-root `discardAttributes` does not reliably drop format-capture scratch fields on this tenant. This pattern works for any quoted string value in a JSON-encoded log line.
- **`$pri{parse=syslogPriority}$` can cause silent event drops on some tenants.** If you suspect priority parsing is the culprit, capture the priority as a plain field (`$pri{regex=\\d+}$`) and skip the parse directive.
- **Indexed positional access `attr[N]` only works in `mappings.version: 1`.** v0 mappings reject `attr[0]`/`attr[1]` syntax. If the source is positional CSV (Palo Alto Firewall is the canonical case), use v1. Reference: `parsers/sentinelone/marketplace-paloaltonetworksfirewall-latest/`.
- **`{parse=gron}` flattens nested JSON to dotted keys, but the keys themselves contain dots.** A source `{"Resource": {"Id": 5}}` becomes the single flat field `unmapped.Resource.Id` (one key with two dots), not a nested object. To rename it use `from: "unmapped.Resource.Id"` (no escapes). To rename a whole subtree use `rename_tree: { from: "unmapped.Resource", to: "resource" }` and the engine walks the dotted-prefix subtree. Reference: `parsers/sentinelone/marketplace-cloudflare-latest/`.
- **`attrBlacklist={field1,field2}` only filters subfields produced by a `{parse=...}` directive.** It does NOT filter top-level captured fields you named explicitly in the format string. To drop a top-level field use `discardAttributes: ["fieldname"]` at the parser root. Reference: `parsers/sentinelone/marketplace-fortinetfortigate-latest/`.
- **`{parse=...}` subfield naming is `<prefix><CapitalizedFirstLetterOfKey><restOfKey>`** (per SDL KB 000006743). Field `details` parsing `?apple=w&banana=x` yields `detailsApple` and `detailsBanana`, NOT `details_apple` / `detailsQuery_apple` / `details.apple`. Same convention for `{parse=json}` (camelCase): `details` parsing `{"foo":"hello"}` produces `detailsFoo`, not `details_foo`. Confirm the exact field name with a sample query if unsure, every "obvious" alternative spelling fails silently.
- **`{parse=uri}` and `{parse=uriAttributes}` consume the parent capture instead of preserving it.** After parsing, the original captured value is gone from the event; only the generated subfields remain (validated against current tenant April 2026). If you also need the raw URL/query string, capture it twice: once with the parse directive, once into a sibling scratch field, and `rename` the scratch one in `mappings`. Or split path/query directly in the format: `$path{regex=[^? ]+}$\??$qs{regex=[^ ]*}{parse=uriAttributes}$`.
- **`{parse=uri}` on relative URLs (no scheme/host) silently drops the query subfields on tested tenants.** It still emits `<prefix>Path`, but `<prefix><Key>` siblings for query parameters never materialize. Use `{parse=uriAttributes}` on the query-string portion (split manually with regex) instead; it works regardless of whether the URL is absolute.
- **`skipNumericConversion: true` is required when columns contain numeric strings you want preserved as strings.** Without it, `commaSeparatedvalues` and `pipeSeparatedValues` parse will coerce `"00123"` → `123` (loses leading zeros), `"0xDEADBEEF"` → `3735928559`, and `"1.0"` → `1`. Set `skipNumericConversion: true` on the format whenever any column is an opaque ID or a hex/octal string. Canonical: Palo Alto Firewall.
- **`intermittentTimestamps: true` is the only fix for sources where only the first record on each second has a timestamp.** Common with MySQL general query log, AWS RDS, sometimes VPC flow logs. Without it, every line that lacks a timestamp gets the ingest timestamp, not the inferred one. Reference: `parsers/sentinelone/marketplace-awsvpcflowlogs-latest/` and `parsers/community/sql_database_logs-latest/`.
- **`enum` cast in v1 mappings without `enum_default` leaves unmapped values UNCHANGED, not null.** If you want unknowns to map to a known sentinel, set `enum_default: <value>` on the cast. Cloudflare uses `enum_default: 99` ("Unknown") consistently, copy that pattern.
- **`severity_id` takes the OCSF integer enum; `severity` is RESERVED and coerced by ingest.** Setting `severity_id: 999` silently fails; the 0-6 range is validated, 99 ("Other") is unvalidated. Emit `severity_id` (int) plus optionally `severity_name` (the OCSF label string). Never emit `severity`, and never emit BOTH `severity` and `severity_id` from the same parser.
- **Rewrites run during format parsing; mappings run after all formats.** A field renamed in `mappings.rename` cannot be referenced by a `rewrites:` block on a later format on the same line because `rewrites:` runs per-format during capture. If you need a derived field from a renamed one, do the derivation inside `mappings` (use `copy` then `cast`, or `replace`).
- **Mixing `mappings.version: 0` and `mappings.version: 1` syntax in the same block is a hard error.** The engine rejects with "expected list got object" or "unsupported event mapper version -1". Pick one version per parser and stick to it.
- **Windows Event Log XML payloads ship with double-escaped tabs/newlines.** A parser for Windows EventLog in the catalog (`parsers/community/microsoft_windows_eventlog-latest/`) deals with `\\t` and `\\n` literals embedded inside XML strings; capturing them needs `\\\\t` / `\\\\n` (four backslashes) at the augmented-JSON layer.
- **Some catalog parsers ship without `dataSource.category` at all (~33% of community).** When you copy from `Sentinel-One/ai-siem`, audit the top-level `attributes:` block. If `dataSource.category` is missing, add it as `"security"`. If present with another value, change it to `"security"`. Same audit for `dataSource.name` and `dataSource.vendor`.
- **`$_=identifier$=$_=quoteOrSpace$` repeating idiom REQUIRES a leading `.*` AND `repeat: true`.** This is the canonical built-in `keyValue` parser shape and it is documented in the public KB as `".*$_=identifier$=$_=quoteOrSpace$"`. Without the leading `.*`, the format anchors at position 0 of the message and fires zero times on any line that doesn't start with an identifier, including every syslog log (`<189>date=...`), CEF (`CEF:0|...`), Windows Event (`<Event xmlns=...>`), or anything with a leading timestamp/priority. The format extracts **nothing** in that case, silently. The `.*` lets the engine scan forward to the first `key=` and then `repeat: true` walks the remaining pairs from there. Tenant-validated 2026-05-26 on FortiGate syslog (`<189>date=2026-05-25 time=18:07:18 devname="..." ...`): without `.*` zero fields captured; with `.*` all 30+ key=value pairs captured. The `keyValue` built-in parser uses exactly this shape (see `examples/03-key-value.json`). If you also need a separate static-prefix capture (e.g. to extract a syslog priority), put it in a SIBLING format that runs before the catch-all, each format runs against the full original `message` independently, so the prefix format and the `.*`-anchored KV format don't compete.
- **Conditional class assignment (one parser, multiple OCSF classes) is best done by stamping `class_uid`/`class_name` on each `format`'s `attributes:` block, not on the parser root.** The root attributes are baseline; per-format attributes override. Reference for fan-out via format-id sentinel + mapping predicates: `parsers/sentinelone/marketplace-awsrdslogs-latest/`.
- **Same-name `rename` in v1 mappings silently NULLS the field.** Writing `{ rename: { from: "action", to: "action" } }` to "keep" a captured raw field under its own name actually deletes the value. The KV catch-all extracts `action` (or any other raw vendor field) directly into the event under its native name, if you want to keep it, OMIT the rename. Only write a rename when the target name is different from the source. Tenant-validated 2026-05-26: identical FortiGate `action="perf-stats"` event returned `action=null` with the self-rename present, `action="perf-stats"` after removing the self-rename. This bites you when "promoting" raw fields that the catch-all already captures.
- **`raw_data` JSON blob is duplicate storage.** Many upstream Observo / collector extractions leave the entire raw event in a `raw_data` field alongside the typed-OCSF fields they extract. If your parser is also extracting those same fields via KV catch-all or named captures, the `raw_data` field is redundant and storage-wasteful. Either `discardAttributes: ["raw_data"]` at parser root or strip upstream. Don't store the same key=value pair three times (typed + unmapped + raw_data); this was the Netskope anti-pattern. Audit on copy.
- **Unquoted numerics captured by `quoteOrSpace` are auto-typed as NUMBER columns.** No explicit cast required. A FortiGate `srcport=44321 dstport=443 sentbyte=8421` line going through `.*$_=identifier$=$_=quoteOrSpace$` produces `srcport: 44321` (number), `dstport: 443` (number), `sentbyte: 8421` (number), all queryable with `avg()`, `sum()`, `> 100`, etc. without `number()` wrapping. The auto-inference fires when the captured token is purely numeric AND unquoted in the source. Quoted values (`level="notice"`) stay as strings even if they look numeric. Tenant-validated 2026-05-26 on FortiGate. Caveat: SDL's column type-locking still applies, if a column was ingested as string earlier, new numeric writes coerce back to string and `avg()` returns NaN. The CLAUDE.md project rule "wrap with `number()` before arithmetic" is still the bulletproof pattern for dashboard panels and STAR rule bodies, especially for counter columns (`traffic.bytes_*`, `traffic.packets_*`, `duration`).
- **`message` field is reserved and preserved on every event regardless of parser activity.** SDL never lets a parser overwrite `message`; the raw event body always survives. Practical consequence: dashboards and PowerQuery hunts that use `parse "fieldname=$x$ " from message` continue to work even after a parser renames the typed columns (`srcip` → `src_endpoint.ip`). This is the backward-compat escape hatch during parser rollout, old events still parse via message-text extraction, new events parse via typed columns. To migrate a dashboard from parse-from-message to typed columns without losing coverage on legacy events, use `(typed_field == * OR raw_field == *)` or `coalesce(typed_field, raw_field)` patterns. Tenant-validated 2026-05-26 on FortiGate dashboard rewrite: panels that switched to `src_endpoint.ip` continued returning the same row counts because the upstream Observo path was already producing typed src_endpoint.ip too; panels using `tls.sni` only show fortigateParser-tagged events because Observo didn't extract SNI.
- **When two ingest paths produce OCSF from the same source, they may flatten `event.type` / `event.subtype` differently.** Common pattern: upstream Observo collector flattens FortiGate `type=traffic subtype=forward` into a single `event.type='forward'` (drops the parent type). The downstream parser keeps both: `event.type='traffic', event.subtype='forward'`. Same source, two schema shapes coexisting on different events. Dashboards and hunts that filter on subtype must use OR: `(event.subtype='forward' OR event.type='forward')`; this matches both legacy and parser-tagged events. The rule: every time you migrate a downstream consumer to typed OCSF columns, audit each subtype filter for backward compat with the upstream shape during the rollover window.
- **`parser='<name>'` field may only be tagged for very recent events.** Some tenants are configured to stamp the `parser` field only on events ingested in the last N minutes (e.g., last 30 minutes). Queries filtering on `parser='myparser'` against a 24h window return only that recent slice, not 24h of data. For broad coverage validation, filter on `dataSource.name` + `metadata.version` (which IS retained per-event) instead, and use `parser=` only for isolating a specific recent ingest test. Tenant-validated 2026-05-26.
### Ingest-path gotchas (discovered empirically via live validation)
These are quirks of the ingest pipeline itself, not the parser DSL. They bite you at validation time even when the parser JSON is syntactically perfect.
- **HEC ingest splits on `\n` BEFORE the parser runs.** Multi-line events (stack traces, MySQL slow queries) get chopped up and `lineGroupers` cannot re-fold them. Workarounds:
1. Fold multi-line events client-side into a single line with a sentinel character (e.g. `\x1e`), then have your parser split on that sentinel.
2. Send each logical event as a single HEC event so newlines inside the event body are preserved.
- **The `server-host` upload header is unreliable for isolating a test.** SDL sometimes overrides the header to the literal source name, and if the parser extracts a `host` field from the log itself that wins too. Do NOT filter your validation query by `host='parser-test-<uuid>'` alone. Safer: filter by `parser='claude_test_<name>'` and `_bytes > 0`, and use a unique nonce in the payload to double-check isolation.
- **`{parse=dottedJson}` prefixes subfields when the field has a non-empty name.** `$payload{parse=dottedJson}$` on `{"user":"alice"}` yields `payload.user = "alice"`. If you want top-level fields, capture into an empty name: `${parse=dottedJson}$`. Same applies to `json`, `escapedJson`, `urlEncodedJson`, `base64EncodedJson`.
- **Existence checks: `config_file(name=...)` returns `None` for a missing path**, it does not raise. The legacy REST `get_file` raises HTTP 404 instead of returning `success=false` with `noSuchFile`. Prefer the GraphQL method and test for `None`. Parsers live at `/logParsers/` and are name-addressed, so no `udoId` is involved.
### `mappings` block gotchas
Two syntaxes coexist on live tenants and both work. You must commit to one per parser, mixing them in the same mappings block produces confusing "expected list got object" errors.
**v1 (singular, preferred for new parsers, tenant-validated April 2026):**
- **`mappings.version: 1` is mandatory.** Without it the tenant returns `unsupported event mapper version -1`.
- **Each transformation is `{<op>: {...body}}`**, where the op name is the **outer key** (e.g. `{rename: {from, to}}`). The public-doc form `{op: "rename", from: ..., to: ...}` is rejected.
- **`rename.from` is a single string**, not a list. Use `copy` (which does accept a list) if you need "first of N".
- **`cast` uses `type:`**, not `to:`. Example: `{cast: {field: "x", type: "int"}}`.
- **`cast` overwrites the source field.** There is no `output:` parameter, `copy` first, then `cast` the copy.
- **Predicates use `==`** (double equals).
**v0 (plural-grouped, used by most S1 Marketplace parsers, AWS RDS, Corelight, Cloudflare, FortiGate):**
- **`mappings.version: 0`**. Same block, different body shape.
- **Ops are plural arrays on the mapping entry**: `renames: [...]`, `copies: [...]`, `constants: [...]`. No `transformations:` wrapper.
- **Every op entry uses `inputs: [list]` + `output:` + `type:`**: even `rename`. `type: "string"` is the safe default.
- **Predicates use `=`** (single equals) in v0, both on the mapping entry and inside `constants`.
- **v0 `constants:` entries are keyed `field`, never `output`.** `[{output, value, type}]` is rejected by `putFile` with `Expected a field`; `[{field, value, type}]` deploys and the constant is applied to events. Live-validated 2026-10-13 (the 2026-05-26 note that every v0 `constants:` block is rejected was the `output` shape). `scripts/lint_parser.py` rule R03 flags the `output` shape.
If you inherit a marketplace parser, keep it on v0 rather than rewriting. For new parsers, pick v1. See `references/mappers.md` for the full side-by-side.
**`constant` / `constants` op** (both versions) is the workhorse for conditional OCSF class/activity assignment, give it a `predicate` and it only fires when matched, so you can fan one vendor-native state code (`conn_state`, `action`, etc.) out into `activity_id` + `
[…] pełny plik w paczce .zip
Files in this package (44)
- SKILL.md 85 KB
- evals/evals.json 22 KB
- evals/fixtures/correct-run/answer.md 1 KB
- evals/fixtures/correct-run/cef_parser.json 2 KB
- evals/fixtures/correct-run/cef_query_result.json 1 KB
- evals/fixtures/correct-run/envelope_parser.json 1 KB
- evals/fixtures/correct-run/envelope_query_result.json 1 KB
- evals/fixtures/correct-run/multiline_parser.json 1 KB
- evals/fixtures/correct-run/multiline_query_result.json 1 KB
- evals/fixtures/correct-run/plan.md 1 KB
- evals/fixtures/correct-run/stdout.txt 4 KB
- evals/fixtures/correct-run/queries/eligibility_probe.pq 1 KB
- evals/samples/cef.log 1 KB
- evals/samples/json_envelope.log 1 KB
- evals/samples/multiline_stack.log 1 KB
- examples/01-cef-over-syslog.json 4 KB
- examples/02-json-with-envelope.json 2 KB
- examples/03-key-value.json 1 KB
- examples/04-multiline-stack.json 2 KB
- examples/05-rewrite-and-mask.json 3 KB
- examples/06-alias.json 1 KB
- examples/07-juniper-srx-rtflow-ocsf.json 5 KB
- examples/08-gron-capture-template.json 7 KB
- examples/09-aws-cloudtrail-assumerole-ocsf.json 11 KB
- examples/10-linux-pam-session-ocsf.json 7 KB
- examples/11-akamai-siem-cef-ocsf.json 12 KB
- examples/12-linux-auditd-ocsf.json 12 KB
- examples/README.md 3 KB
- references/ai-siem-catalog.md 17 KB
- references/builtin-parsers.md 4 KB
- references/canonical-parsers.md 3 KB
- references/mappers.md 23 KB
- references/ocsf-mapping.md 14 KB
- references/ocsf-schema-documentation.md 945 KB
- references/onboarding-learnings.md 2 KB
- references/parse-directives.md 15 KB
- references/parser-eligibility.md 8 KB
- references/per-app-sentinel.md 2 KB
- references/syntax.md 17 KB
- references/testing-workflow.md 10 KB
- scripts/lint_parser.py 5 KB
- scripts/parser_rules.py 31 KB
- tests/test_lint_parser.py 13 KB
- tests/test_sdl_log_parser_skill_invariants.py 12 KB
Versions
The database has no other skills named sdl-log-parser.
Database snapshot: 13.11.2026 · package version 3d586022a59f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100sdl-dashboard
Use this skill any time the user wants to create, edit, design, generate, deploy, or debug a SentinelOne Singularity Data Lake (SDL) dashboard. Triggers include: "build me a dashboard", "create a dashboard panel", "write dashboard JSON", "add a panel to my dashboard", "deploy a… - 95Parser
Parse URLs, files, videos to JSON. USE WHEN parse, extract, URL, transcript, entities, JSON, batch, content, YouTube, PDF, article. SkillSearch('parser') for docs. - 95create-parser
Design an SC4S syslog-ng parser from raw log samples, optionally deploy it through the SC4S MCP server. Use when onboarding a new vendor or product, adding a custom log source, or creating parser logic for unsupported logs. - 100pdf-parser
Configure and manage - Parse pdf parser operations. Auto-activating skill for Business Automation. Triggers on: pdf parser, pdf parser Part of the Business Automation skill category. Use when working with pdf parser functionality. Trigger with phrases like "pdf parser", "pdf parser", "pdf". - 100content-parser
Extract and parse content from URLs. Triggers on: user provides a URL to extract content from, another skill needs to parse source material, "parse this URL", "extract content", "解析链接", "提取内容". - 95Parser
Extract structured JSON from URLs, files, videos, PDFs with entity extraction and batch support. USE WHEN parse, extract, URL, transcript, entities, JSON, batch, content, YouTube, PDF, article, newsletter, Twitter, browser extension, collision detection, detect content type,…