8000 Support OCSF extensions in `ocsf::apply` by jachris · Pull Request #5306 · tenzir/tenzir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Jun 27, 2025
Merged

Support OCSF extensions in ocsf::apply #5306

merged 1 commit into from
Jun 27, 2025

Conversation

jachris
Copy link
Contributor
@jachris jachris commented Jun 27, 2025

The ocsf::apply operator now supports OCSF extensions. This means that metadata.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 the win and linux extensions.

8000 @jachris jachris added feature New functionality operator Source, transformation, and sink labels Jun 27, 2025
Copy link
github-actions bot commented Jun 27, 2025

📚 Documentation Preview

🧹 Preview deployment has been cleaned up

The documentation preview for this PR has been removed since the PR was closed.

@jachris jachris force-pushed the topic/ocsf-extensions branch from c88ce06 to 642210f Compare June 27, 2025 11:01
@jachris jachris marked this pull request as ready for review June 27, 2025 11:02
@jachris jachris force-pushed the topic/ocsf-extensions branch from 642210f to 8817af3 Compare June 27, 2025 11:10
@jachris jachris requested a review from dominiklohmann June 27, 2025 11:11
Copy link
Member
@dominiklohmann dominiklohmann left a 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.

@dominiklohmann dominiklohmann requested a review from Copilot June 27, 2025 12:03
Copy link
Contributor
@Copilot Copilot AI left a 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

@jachris jachris merged commit 5ab3117 into main Jun 27, 2025
60 checks passed
@jachris jachris deleted the topic/ocsf-extensions branch June 27, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality operator Source, transformation, and sink
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0