Fortinet How to Configure

How to build and test a FortiSIEM parser for unrecognized syslog

Start with a raw syslog event in Analytics. Give one synthetic backup job format a parser, prove that unrelated fixtures stay outside its scope, then verify a fresh event with searchable job, status, and duration fields.

QuantumCrafters Studio · Guide 6 of 12

From raw syslog to a searchable event

Raw syslog <134>Dec 5 10:00:00 qcs-job-lab QCS_JOB_V1: job=backup status=ok duration_ms=128

Recognizer

Checks the format marker

Waiting for a match

Field extraction

Maps job, status and duration

Event record

Unknown_Event_Type
qcsJobName
—
qcsJobStatus
—
qcsJobDurationMs
—
The raw event arrives The Collector receives the synthetic job log. Analytics still shows it as an unknown event type.
Event Type = Unknown_Event_Type
Simulated lab trace. The parser test proves matching and field extraction. After Enable and Apply, a fresh event in Analytics verifies the deployed result.

Capture the unrecognized event

This walkthrough uses FortiSIEM 7.5.1 and a registered Collector in an isolated lab. Read the raw record and Reporting IP in Analytics → Load Report → Shortcuts → Raw Messages. Copy the exact line FortiSIEM received, including the header, spaces, and punctuation. When no parser matches, the documented event type is Unknown_Event_Type. An existing generic parser may assign a different type, so record the type you actually see. FortiSIEM syslog onboarding and searches · FortiSIEM parser selection

Use a dedicated sender address for the lab. Fortinet documents top-to-bottom recognizer evaluation and parser reuse for logs from the same reporting IP. Relays and shared sender addresses can change which parser FortiSIEM associates with a source. Record the reporting address FortiSIEM actually sees, along with the current parser order and any explicit CMDB parser assignments. 192.0.2.40 is the example reporting address in this guide. FortiSIEM parser order · FortiSIEM associating parsers to a device

Use this synthetic line as the first parser fixture.

<134>Dec  5 10:00:00 qcs-job-lab QCS_JOB_V1: job=backup status=ok duration_ms=128

The sender hostname is qcs-job-lab and the format marker is QCS_JOB_V1. The expected result is event type QCS-Job-Run, with job backup, status ok, and duration 128 milliseconds. Keep the raw record as the comparison. The procedure and diagram show expected behavior. Appliance validation is pending.

Define the application, fields, and event type

  1. In Admin → Device Support → Devices/Apps, click +. Choose the application category. Set Vendor to QCS Lab, Model to Job Runner, and Version to 1. Select an existing application group appropriate for the lab and save. FortiSIEM device and application definitions
  2. In Admin → Device Support → Event Attributes, click + and create the three fields below. Enter the exact internal Name used by the XML. Set Display Name and Value Type, save, and use Apply for the new definitions. FortiSIEM event attribute definitions
  3. In Admin → Device Support → Event Types, click + and name the type QCS-Job-Run. Select the new QCS Lab / Job Runner device type, an existing event group for lab operations, and severity 1. Save and apply the new definition. FortiSIEM event type definitions
Internal name Display name Value type Example
qcsJobName QCS Job Name String backup
qcsJobStatus QCS Job Status String ok
qcsJobDurationMs QCS Job Duration (ms) Unsigned integer (uint32) 128

The lab uses one low-severity event type for job reports. The status field holds the result of each run. A failed fixture therefore keeps the same event type and carries failed in QCS Job Status.

Build the recognizer and extract fields

Open Admin → Device Support → Parsers. Select the entry after which to insert the new parser and click +. Name it QCSJobV1Parser and select the new lab device type. The new parser starts disabled while you write and test it. FortiSIEM parser creation workflow

Use the XML below for the exact fixture format. The recognizer checks the timestamp format, dedicated hostname, QCS_JOB_V1 marker, and the three required fields in order. An optional syslog priority prefix accommodates fixtures where the received line retains it. The extraction uses named FortiSIEM patterns on the raw input and populates the three registered attributes. Its job name and duration lengths are deliberate lab bounds. FortiSIEM parser XML specification · FortiSIEM local and built-in patterns · FortiSIEM field extraction functions

<eventParser name="QCSJobV1Parser">
  <patternDefinitions>
    <pattern name="patQcsJobName"><![CDATA[[a-z][a-z0-9_-]{0,31}]]></pattern>
    <pattern name="patQcsJobStatus"><![CDATA[(?:ok|failed)]]></pattern>
    <pattern name="patQcsJobDuration"><![CDATA[[0-9]{1,6}]]></pattern>
  </patternDefinitions>
  <eventFormatRecognizer><![CDATA[^(?:<:gPatSyslogPRI>)?<:gPatMon>[ \t]+<:gPatDay>[ \t]+<:gPatTime>[ \t]+qcs-job-lab[ \t]+QCS_JOB_V1:[ \t]+job=<:patQcsJobName>[ \t]+status=<:patQcsJobStatus>[ \t]+duration_ms=<:patQcsJobDuration>[ \t]*$]]></eventFormatRecognizer>
  <parsingInstructions>
    <collectFieldsByRegex src="$_rawmsg">
      <regex><![CDATA[QCS_JOB_V1:[ \t]+job=<qcsJobName:patQcsJobName>[ \t]+status=<qcsJobStatus:patQcsJobStatus>[ \t]+duration_ms=<qcsJobDurationMs:patQcsJobDuration>[ \t]*$]]></regex>
    </collectFieldsByRegex>
    <setEventAttribute attr="eventType">QCS-Job-Run</setEventAttribute>
    <setEventAttribute attr="eventName">QCS Job Run</setEventAttribute>
    <setEventAttribute attr="eventSeverity">1</setEventAttribute>
  </parsingInstructions>
</eventParser>

In an editor that already supplies the outer parser wrapper, enter the three child sections inside that wrapper. Keep the regex in CDATA and each pattern on one line. The parser keeps FortiSIEM's received-event metadata and raw log. The lab search uses Event Receive Time. A separate Device Time mapping would need a reliable timestamp and timezone from the sender. FortiSIEM setting event attributes · FortiSIEM 7.5.1 base event attributes

Validate and test the parser

Click Validate to check the XML syntax. Then open Test, add the two expected matches, and run the test. Inspect Result, Expected Parser, and Used Parser. For each matching line, look for Passed and QCSJobV1Parser as the used parser. Select the result and compare its full parsed attribute values with the expected values below. FortiSIEM Validate and Test workflow

Fixture Expected result
Provided QCS_JOB_V1 line with job=backup status=ok duration_ms=128 QCS-Job-Run, backup, ok, numeric 128
Same header and marker, with job=archive status=failed duration_ms=2048 QCS-Job-Run, archive, failed, numeric 2048
Same header, with QCS_JOB_V2: job=backup status=ok duration_ms=128 Different format version. The lab parser should have no match.
Same header and marker, with job=backup status=ok Required duration is absent. The lab parser should have no match.
An ordinary benign syslog line from a different lab source Its baseline parser or unrecognized result should stay the same.

Check the non-match controls separately. A control can show a failed expectation when the Test window expects QCSJobV1Parser, since a different parser or no parser is the desired result. Inspect Used Parser and verify the control never receives QCS-Job-Run. Keep only the two positive fixtures as the saved test events for the parser's enable check. After deployment, repeat the controls from isolated lab sources and compare with their baseline.

Check parser order, enable, and apply

If a positive test uses another parser, record its name and review the earlier recognizer. FortiSIEM tries parsers in list order. Keep the new recognizer scoped to this format and review any necessary order change in the lab. If the specific parser needs to precede the broader one, move just that entry and retest both expected matches and neighboring formats. Check for explicit parser assignments in CMDB → Devices → Edit → Parsers, since those parsers are attempted first for the selected device. FortiSIEM parser order and Apply · FortiSIEM explicit parser association

When the expected tests pass, return to the editor and save. Select the new parser in the list and use Enable, then click Apply. Apply distributes the parser change to the FortiSIEM nodes, so use the isolated deployment and keep the original order available for rollback. Record the change time so the live check can distinguish fresh records from the baseline.

Verify a fresh parsed event in Analytics

Have the dedicated lab sender emit a fresh instance of the positive fixture as part of its approved syslog workflow. Note the send time and actual reporting address. In Analytics, open an unaggregated search for that reporting IP and a receive-time window after Apply. First confirm the new raw line reached FortiSIEM, then filter for Event Type = QCS-Job-Run. Display Event Type, Reporting IP, Event Receive Time, Raw Event Log, and the three QCS fields. FortiSIEM creating a search · FortiSIEM unaggregated results and raw messages

Confirm the matched event row contains backup, ok, and numeric 128, beside the corresponding raw line. Repeat with the second positive variant to establish that the values come from the message. Compare fresh controls with their baseline on their own lab source where the reporting-IP assignment requires it. Save the received timestamp, event type, fields, and raw line together. The format match and data extraction are proven by these live checks after the editor test.

Troubleshoot the first failed check

Symptom Check first
No fresh raw line appears Confirm the lab sender, transport, Collector listener, reporting address, and receive-time window.
Validate shows an error Check the parser wrapper supplied by the editor, CDATA boundaries, and the registered internal field names.
Test shows another Used Parser Review the earlier matching recognizer and the approved parser order. Verify the exact raw sample in the Test window.
The expected Event Type appears with an empty field Confirm the field's exact internal name and value type, the delimiter and case in the raw line, and the effective parser definition.
Test passes but a fresh event uses a different parser Confirm Apply completed for the ingesting node. Check the actual reporting IP, relay behavior, CMDB parser association, and the effective deployed order.

Roll back and preserve evidence

Disable QCSJobV1Parser and restore the recorded parser order if it changed. Click Apply and send a fresh lab record. Confirm the source again follows the baseline behavior and check the neighboring lab controls. Restore an explicit lab CMDB association if one changed. Keep the event and attribute definitions available for any lab history that still references them. Save the tested fixtures, XML entry, before-and-after order, Used Parser results, and matching raw and parsed records with sensitive details redacted.