-
Notifications
You must be signed in to change notification settings - Fork 17
update(api): Add value offset support #103
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
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: geraldcombs The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 extends the SDK's extraction API by adding support for a new field type, FieldMetaTypeSlice, which allows extractor plugins to report field metadata (i.e. the start and end positions of fields).
- Updated the extract request interface and its SetValue method to support a two-element uint32 pair for metadata.
- Added new symbols and tests in the info and extract test files to validate the metadata extraction capability.
- Enhanced the plugin Info structure and documentation to reflect the new metadata capability.
Reviewed Changes
Copilot reviewed 8 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/sdk/extract.go | Extended SetValue to support FieldMetaTypeSlice |
pkg/sdk/symbols/info/info.go | Added get_extract_metadata_capability symbol |
pkg/sdk/symbols/info/info_test.go | Added tests for extracting metadata capability |
pkg/sdk/sdk.go | Defined new constant FieldMetaTypeSlice |
pkg/sdk/extract_test.go | Added helper and tests for the metadata slice extraction |
pkg/sdk/plugins/plugins.go | Updated Info struct to include metadata capability |
pkg/sdk/symbols/doc.go | Updated documentation to list get_extract_metadata_capability |
Files not reviewed (7)
- Makefile: Language not supported
- pkg/loader/plugin_api_include.patch: Language not supported
- pkg/loader/plugin_loader.c: Language not supported
- pkg/loader/plugin_loader.h: Language not supported
- pkg/loader/strlcpy.patch: Language not supported
- pkg/sdk/plugin_types.h: Language not supported
- pkg/sdk/plugin_types_include.patch: Language not supported
Comments suppressed due to low confidence (1)
pkg/sdk/extract.go:362
- [nitpick] The panic message for unsupported lists of slices is terse. Consider enhancing it with additional context about the memory layout restriction that prevents lists of slices from being supported.
case FieldMetaTypeSlice:
/hold depend on falcosecurity/libs#2322 |
3210c82
to
f1e688d
Compare
e499d27
to
3fb7eeb
Compare
918aacb
to
b36359e
Compare
Add support for setting value offsets during extraction. Signed-off-by: Gerald Combs <[email protected]>
b36359e
to
63792cd
Compare
Add support for FTYPE_METADATA_SLICE and CAP_EXTRACT_METADATA so that we can extract the location of each field.
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area plugin-sdk
What this PR does / why we need it:
This makes it possible to extend extractor plugins so that they can provide the location of each field in each event or log message.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: