# Create 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.

- Skill: `splunk/create-parser` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx get-skill add splunk/create-parser`
- Raw SKILL.md: https://api.skillmd.com/api/skills/splunk/create-parser/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: splunk (https://skillmd.com/u/splunk)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/splunk/create-parser

---


# Create SC4S Parser

Guide the operator through collecting representative logs, designing an SC4S parser, optionally deploying it, and verifying the resulting event routing.

## 1. Collect requirements and samples

Ask once for all missing information:

- Full positive log lines. Prefer at least three examples covering different event types or layouts; require at least one.
- Vendor, product, and device or software version. Offer inferred values for confirmation when unknown.
- Desired Splunk index and sourcetype. Offer a conventional value for confirmation when unknown.
- Whether the parser should only route events or also extract named values, which values matter, and the exact expected value for each supplied sample.
- How the final event should appear in Splunk: preserve only the message body, preserve a reconstructed header plus the message, preserve RFC5424 structured data, replace the body with normalized key/value text, or replace it with JSON. Explain that this choice controls the SC4S template, may not reproduce the original wire bytes, and is separate from Splunk search-time field definitions.
- When the original message must be preserved, whether extracted values should remain internal to SC4S or be sent as indexed HEC fields.

Do not proceed until at least one complete positive log, vendor, product, index, sourcetype, and desired final event format are known or explicitly confirmed. If only one positive example is available, continue but state that filter confidence is limited and request additional examples before production rollout.

## 2. Gather parser knowledge

Read `parser-guide.md` next to this file before designing the parser. It is the bundled baseline for SC4S parser structure, filters, rewrites, templates, and deployment layout.

When the SC4S repository lookup tools are available:

1. Read the current `sc4s://docs/creating_parsers` resource when the client exposes it. Otherwise call `search_docs(query)` for the relevant format, topic, parser method, or rewrite question.
2. Call `list_vendors` to check for existing vendor support.
3. When the vendor exists, call `list_vendor_parsers(vendor)`, then `get_parser(parser_name)` for the closest parser. Reuse conventions, not product-specific assumptions.

Use these lookups to supplement the bundled guide, not replace it.

## 3. Design the parser

Analyze every supplied sample and create a complete `.conf` file:

1. Identify RFC3164, RFC5424, CEF, LEEF, JSON, or a supported almost-syslog variant described by the guide.
2. Select the narrowest reliable application topic and filter. Prefer structured identity or program values over message-text matching. Account for the positive samples and avoid the supplied negative examples.
3. Select parser stages, namespaces, and an output template together. Keep intermediate fragments in `.tmp.*`; put only intentionally serialized values in `.values.*`; use `fields.*` only when the operator requested indexed HEC fields. Follow the bundled guide's template, namespace, and quoting rules.
4. Set the confirmed index, sourcetype, vendor, product, and template through SC4S rewrite conventions.
5. Set `<filename>` to `app-<type>-<vendor>_<product>.conf`. Normalize it to lowercase, use underscores within vendor/product identifiers, retain the `.conf` suffix, and reject path separators, traversal components, or an empty name.
6. Use only documented options for each function. Before previewing or deploying, check the parser's syntax and ensure it ends with `;`.

Show the exact `<filename>` and complete parser. Explain:

- The detected format, application topic, and filter.
- Why each positive sample should match and why negative examples should not.
- The selected index, sourcetype, `vendor_product`, template, resulting event-body format, and extracted-field delivery method.
- A compact table of every requested field and its expected value for each supplied sample.
- Any assumptions caused by missing samples or product information.

If an external metadata override is needed, recommend `$manage-sc4s-splunk-metadata`; do not refer to an undefined `sc4s:configure` command.

Ask whether the parser needs adjustments. Revise and repeat the explanation until the operator approves the content. Treat this as authoring approval only, not permission to mutate SC4S.

## 4. Optionally deploy

Ask whether to deploy the approved parser.

If `$manage-sc4s-parsers` is available, hand off the exact approved `<filename>` and parser content to that skill. Follow its read-before-write, overwrite warning, fresh confirmation, asynchronous job polling, read-back, health verification, conflict handling, and rollback-preservation workflow. Do not call `add_parser` directly from this skill, and do not reuse authoring approval as deployment confirmation.

If the management skill is unavailable or the operator prefers manual deployment:

1. Save the file as `/opt/sc4s/local/config/app_parsers/<filename>`.
2. Restart the SC4S runtime using the operator's deployment method.
3. Inspect runtime logs for syslog-ng configuration or restart errors.

Always provide the complete parser content for manual copy and preserve the approved filename exactly.

## 5. Verify event routing

After either deployment path:

1. Send a positive sample through the same transport and source path used by the device.
2. Verify in Splunk that it arrives in the confirmed index and sourcetype with the intended vendor, product, template output, and requested extracted fields.
3. When a negative example exists, send or search for it and verify that the new parser did not route it into the new sourcetype.
4. If verification fails, report the observed mismatch and return to parser design. Do not redeploy a revision without a new preview and confirmation through `$manage-sc4s-parsers`.

Use precise completion language:

- Job success, exact read-back, and healthy SC4S means **deployed and runtime-verified**.
- A correctly routed positive sample with expected metadata and fields means **end-to-end verified**.
- If the operator cannot perform the Splunk check, report deployment status and state explicitly that end-to-end verification remains outstanding.

