The shorthand log format is optimized for humans and agents reading logs in real time. For machine consumption, compliance archival, or SIEM integration, you can enable full OCSF JSON export. This writes every OCSF event as a complete JSON record in JSONL format, one JSON object per line.
Use the ocsf_json_enabled setting to toggle JSON export. The setting can be applied globally, for all sandboxes, or per-sandbox.
Global:
Per-sandbox:
The setting takes effect on the next poll cycle, by default every 10 seconds. No sandbox restart is required.
To disable:
When enabled, OCSF JSON records are written to /var/log/openshell-ocsf.YYYY-MM-DD.log inside the sandbox. The file rotates daily and retains the 3 most recent files, matching the main log file rotation.
Each line is a complete OCSF v1.7.0 JSON object. Here is an example of a network connection event:
And a denied connection:
The JSON examples above are formatted for readability. The actual JSONL file contains one JSON object per line with no whitespace formatting.
The class_uid field identifies the event type:
The JSONL file can be shipped to any tool that accepts OCSF-formatted data:
Example with jq to extract all denied connections:
The shorthand format in openshell.YYYY-MM-DD.log and the JSON format in openshell-ocsf.YYYY-MM-DD.log are derived from the same OCSF events. The shorthand is a human-readable projection; the JSON is the complete record. Both are generated at the same time from the same event data.
The shorthand log is always active. The JSON export is opt-in through ocsf_json_enabled.