Skip to content
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

Filterx parse leef 2.0 #343

Merged
merged 7 commits into from
Nov 8, 2024
Merged

Conversation

bshifter
Copy link
Member

This PR adds support for the LEEF 2.0 format, specifically focusing on its dynamic header field, delimiter. The task required a significant refactor of the event-parser base module and the unit test framework. Additionally, it introduces optional named arguments for the filterx function, allowing for forced overrides of pair-separator and value-separator. This enhancement will enable us to parse specific non-standard CEF/LEEF messages more effectively.

examples:

filterx {
  dict = {};
  dict.A = parse_cef($MSG, pair_separator="^", value_separator="#");
  dict.B = parse_cef($MSG);
  dict.C = parse_leef($MSG);
  dict.D = parse_leef($MSG, pair_separator="|");
}

@bshifter bshifter force-pushed the filterx-parse-leef2 branch 2 times, most recently from 86e8938 to 79f13cb Compare October 16, 2024 18:01
@alltilla alltilla self-requested a review October 24, 2024 08:48
lib/scanner/csv-scanner/csv-scanner.c Show resolved Hide resolved
modules/cef/filterx-func-parse-cef.h Outdated Show resolved Hide resolved
modules/cef/filterx-func-parse-leef.h Outdated Show resolved Hide resolved
modules/cef/event-format-parser.c Outdated Show resolved Hide resolved
modules/cef/event-format-parser.c Outdated Show resolved Hide resolved
modules/cef/event-format-parser-cfg.h Show resolved Hide resolved
@bshifter bshifter force-pushed the filterx-parse-leef2 branch from 79f13cb to dcd0227 Compare November 8, 2024 14:20
… data without using expected columns mode

Signed-off-by: shifter <[email protected]>
…for improved thread safety. This was required to accommodate the dynamic parsing of the optional delimiter field in LEEF 2.0.

Additionally, introduce optional arguments named `field_separator` and `value_separator` in the filterx function to enforce specific separators.

Signed-off-by: shifter <[email protected]>
…EEF 2.0 version.

Changes include:
- Updated usage message
- Enhanced version parsing
- Added optional 'delimiter' field to parse and configure the LEEF extension's pair separator based on the specified delimiter value.

Signed-off-by: shifter <[email protected]>
- Moved to a separate unit to improve organization due to their size
- Implemented `va_args` functions for more flexible construction of filterx function arguments
- Generalized helper functions to reduce code duplication in CEF/LEEF tests

Signed-off-by: shifter <[email protected]>
- Utilize the updated test helpers module
- Include additional tests for enforcing pair-separator and value-separator functionality

Signed-off-by: shifter <[email protected]>
- Utilize the updated test helpers module
- Include additional tests for enforcing pair-separator and value-separator functionality
- Add extra tests for parsing and utilizing the optional `delimiter` field in LEEF 2.0

Signed-off-by: shifter <[email protected]>
@bshifter bshifter force-pushed the filterx-parse-leef2 branch from dcd0227 to 6ba689f Compare November 8, 2024 15:14
@alltilla alltilla merged commit bfc93a7 into axoflow:main Nov 8, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants