parse_cef
Syntax
parse_cef()Description
The parse_cef() function processes a CEF string and returns an object whose structure (key and
value pairs) is determined by the input parameters.
Example: Parsing CEF logs during ingestion
The following example demonstrates how to use the parse_cef function within a parsing rule to process raw logs and store the resulting object in a specific dataset. This logic is configured in the INGEST section to execute as data is written to Cortex XDR.
[INGEST:vendor="test", product="parse_cef", target_dataset="test_parse_cef_raw", no_hit = keep]
alter raw ="<14>Oct 2 10:06:18 PAN-PROD-APPSVC-EU-W4-FW01 CEF:0|Palo Alto Networks|PAN-OS|8.1.15-h3|end|TRAFFIC|1|rt=Oct 02 2022 17:06:18 GMT src=35.204.254.72 app=ssl proto=TCP in=8697 double=1.15 mac=B3-F5-10-ED-C4-EE ad.vd=root ad.subtype=forward pattern:test=test"
| alter parsed = parse_cef(raw)
| fields parsed;Explanation of the rule components:
INGESTsection: Defines thevendor,product, and thetarget_datasetwhere the parsed logs will be stored.alter raw: In this rule context, this defines the source string to be parsed (simulating the_raw_loginput).parse_cef(raw): Processes the CEF string into a structured object containing key-value pairs.Semicolon (
;): Required at the end of the rule to ensure proper compilation.
Output results
The following JSON represents the structured object stored in the parsed field of the test_parse_cef_raw dataset after the rule is applied:
Last updated
Was this helpful?
