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

field_manager behavior change from v11.3.0 to v12.0.0 #608

Closed
dtrai2 opened this issue Jun 14, 2024 · 1 comment · Fixed by #616
Closed

field_manager behavior change from v11.3.0 to v12.0.0 #608

dtrai2 opened this issue Jun 14, 2024 · 1 comment · Fixed by #616
Assignees
Labels
bug Something isn't working verified

Comments

@dtrai2
Copy link
Contributor

dtrai2 commented Jun 14, 2024

The field_manager processor had a behavior change in the last version that was not highlighted as a breaking change. It should be discussed if this new behavior is wanted or if the old behavior should be recovered.

Changed behavior
In the previous version the field_manager could turn a target_field that already existed, and which was not of type list, into a list by appending a source_field with the argument extend_Target_list: true. In version 12 the field_manager now complains and adds a _field_manager_failure tag instead.

Steps to reproduce
Add the following test case to the tests/unit/processor/field_manager/test_field_manager.py test_cases list and execute it with logprep version 11.3.0 and logprep version 12.0.0. In one version the test passes and in the other version the test fails.

test_cases = [  # testcase, rule, event, expected
    (
        "Convert existing target to list",
        {
            "filter": "message",
            "field_manager": {
                "source_fields": ["message"],
                "target_field": "new_field",
                "extend_target_list": True
            },
        },
        {"message": "Value B", "new_field": "Value A"},
        {"message": "Value B", "new_field": ["Value A", "Value B"]},
)]

@ekneg54 @djkhl what are your takes on it?

@dtrai2 dtrai2 added the bug Something isn't working label Jun 14, 2024
@ekneg54
Copy link
Collaborator

ekneg54 commented Jun 20, 2024

confirmed ... I think this is a bug. It should be as you suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants