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

Feature: Add more flexible rules for match_fields #536

Closed
HeadHunter483 opened this issue Nov 1, 2023 · 0 comments · Fixed by #537
Closed

Feature: Add more flexible rules for match_fields #536

HeadHunter483 opened this issue Nov 1, 2023 · 0 comments · Fixed by #537
Labels
enhancement New feature or request

Comments

@HeadHunter483
Copy link
Collaborator

Currently match_fields can only check fields and whether their values are equal to some of the strings. It would be great to have more flexible way to match fields values by prefix, suffix, contains rules as well and combining them with logical operators.

There was a proposal of do_if field with more complicated rules than match_fields in this issue. And I suggest that it would be interesting to expand it to the tree of nodes, where each node is either logical operator or field operator:

pipelines:
  k8s:
    actions:
      - type: 'modify'
        service: 'unknown'
        do_if:
          logical_op: 'or'
          operands:
            - field_op: 'equal'
              field: 'service'
              values:
                - null
                - '' # empty string
            - field_op: 'contains'
              field: 'message'
              values:
                - 'unknown-service'
@HeadHunter483 HeadHunter483 added the enhancement New feature or request label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant