Repository navigation
fix(supervisor): rename OCSF log files from .log to .jsonl - #4263
Merged
matthewgrossman merged 8 commits intoOct 14, 2026
Merged
Conversation
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-pr-4263.docs.buildwithfern.com/openshell |
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
matthewgrossman
marked this pull request as ready for review
October 13, 2026 17:13
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
.log to .jsonl
krishicks
previously approved these changes
Oct 13, 2026
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
krishicks
approved these changes
Oct 14, 2026
matthewgrossman
deleted the
fix/4256-ocsf-jsonl-retention/matthewgrossman
branch
October 14, 2026 17:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change the supervisor OCSF output filename from
/var/log/openshell-ocsf.YYYY-MM-DD.logto/var/log/openshell-ocsf.YYYY-MM-DD.jsonl. The extension changes from.logto.jsonl; the directory remains/var/log. This is backward-incompatible for collectors and scripts matching the old filenames. Distinct suffixes prevent shorthand retention from pruning newly generated OCSF JSONL files. Shorthand filenames, daily rotation, and the existing three-file limits remain unchanged.Related Issue
Closes #4256
Replaces the closed draft #4257 on a fresh branch from
main.Changes
logtojsonl; keep the existing appender setup. Gateway/MXC filenames remain unchanged.openshell-ocsf.*.loghistory. It was already subject to early shorthand pruning and remains eligible for it. Remove the migration helper and its tests..jsonlfilenames.Compatibility and release
OCSF consumers must change their collection pattern from
openshell-ocsf.*.logtoopenshell-ocsf.*.jsonl. Legacy files are not migrated or protected from shorthand cleanup; collect any needed history before upgrading. New Docker/Podman supervisor containers and Kubernetes supervisor pods start with empty log storage, while host-based VM supervisors may encounter existing files. Gateway/MXC consumers are unaffected.This backward-incompatible filename change likely needs a minor version bump rather than a patch release. Confirm the release/versioning decision with the release owners before shipping; this PR does not change version files.
Why there is no legacy-log migration
This fix intentionally applies only to newly generated
.jsonlfiles. Old OCSF.loghistory already had broken retention and could be pruned early by the shorthand writer; we are not introducing a history-preservation guarantee for those files. New Docker/Podman supervisor containers use fresh tmpfs storage, and new Kubernetes supervisor pods use freshemptyDirstorage, so those replacement resources have no old files to migrate. Keeping this change to a suffix update avoids migration code and failure handling for already best-effort, usually ephemeral history.This is not a claim that every upgrade clears logs: Kubernetes container restarts within the same pod preserve
emptyDir, and VM supervisors can use persistent host storage. Any remaining old.logfiles stay eligible for shorthand pruning. Operators needing that history must collect it before upgrading; this PR neither migrates nor explicitly deletes it.Filename dependency audit
jqexample indocs/observability/ocsf-json-export.mdxexplicitly matchedopenshell-ocsf.*.log. That example, the filename references indocs/observability/logging.mdxanddocs/observability/accessing-logs.mdx, and the embeddedcrates/openshell-supervisor-process/src/skills/policy_advisor.mdare updated in this PR. Users following the old documented collection pattern must update it.crates/openshell-driver-mxc/examples/run-ocsf-audit.ps1has an actualopenshell-ocsf*.logfile search, but consumes the Windows gateway sink, whose filenames remain unchanged./v1/denialsreader incrates/openshell-supervisor-network/src/policy_local.rsdepends on shorthandopenshell.*.logfilenames, which remain unchanged.tasks/scripts/helm-k3s-local.shreceives traces over OTLP rather than tailing these files. Repository searches found no OTelfilelog, Filebeat, or Fluent Bit configuration consuming the supervisor OCSF files.The compatibility risk has concrete documentation/example evidence, but no external deployment was verified. Absence of an in-repo collector configuration does not establish that external consumers are unaffected.
Testing
Passed locally on macOS:
mise exec -- cargo test -p openshell-supervisor --bin openshell-supervisor --locked(13 tests after merging main)mise exec -- cargo test -p openshell-supervisor-network --lib policy_local::tests --locked(38 tests)mise exec -- cargo test -p openshell-supervisor-process --lib skills::tests --locked(3 tests)mise exec -- cargo clippy -p openshell-supervisor --all-targets --locked -- -D warningsmise run docs, andgit diff --check. Fern reported zero errors and three existing warnings.After merging main, the suffix change lives in its existing
logging.rshelper, and the existing console/file test asserts the.jsonlextension. Main's JSON stderr output is preserved. The denial-reader test excludes current.jsonlOCSF files; legacy filename coverage and legacy-history guidance in the published docs are removed. The helper module and its retention/migration tests are removed to keep this fix to the suffix change and collection guidance. Before this simplification, independent startup and real rollover with distinct suffixes passed on a filesystem exposing creation timestamps; those tests are not retained in this PR.Checklist