-
-
Notifications
You must be signed in to change notification settings - Fork 98
Support OCSF extensions in ocsf::apply
#5306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📚 Documentation Preview🧹 Preview deployment has been cleaned up The documentation preview for this PR has been removed since the PR was closed. |
c88ce06
to
642210f
Compare
642210f
to
8817af3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice, thanks especially for the thorough tests. The code is also surprisingly clean for this still... I was wondering whether code quality would suffer once we add more and more support for OCSF features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for OCSF extensions in the ocsf::apply
operator by reading metadata.extensions
alongside version and profiles, updates the schema generator to emit #extension
attributes, and provides tests covering valid and invalid extension scenarios.
- ocsf::apply now filters fields by enabled extensions and emits warnings when extensions are malformed or missing
ocsf-schemas.py
emits#extension
annotations and writes enums/versions including extension metadata- Comprehensive TQL/JSON test cases for wrong and correct
metadata.extensions
usage
Reviewed Changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tenzir/tests/ocsf/*.tql & *.txt | Added tests for invalid and valid metadata.extensions shapes |
scripts/ocsf-schemas.py | Emit #extension tags, generate versions/inc, update mangle |
libtenzir/src/ocsf.cpp | Switch to versioned lookup with ocsf_version enum |
libtenzir/include/tenzir/ocsf.hpp | Introduce ocsf_version enum and version-aware signatures |
libtenzir/builtins/operators/ocsf.cpp | Apply extension filtering in caster and operator pipelines |
libtenzir/builtins/functions/ocsf.cpp | Update mapping plugin to accept version parameter |
docs/operators/ocsf/apply.md | Document metadata.extensions as a fourth input dimension |
The
ocsf::apply
operator now supports OCSF extensions. This means thatmetadata.extensions
is now also taken into account for casting and validation. At the moment, only the extensions versioned together with OCSF are supported. This includes thewin
andlinux
extensions.