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

Allow grep filter logical_op #1316

Open
ba-work opened this issue Aug 20, 2024 · 0 comments
Open

Allow grep filter logical_op #1316

ba-work opened this issue Aug 20, 2024 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ba-work
Copy link

ba-work commented Aug 20, 2024

Is your feature request related to a problem? Please describe.

The grep filter support is incomplete, I want to be able to at least use multiple excludes: https://docs.fluentbit.io/manual/pipeline/filters/grep#multiple-conditions

Describe the solution you'd like

Ideally I could do something like this to filter namespaces at a cluster level:

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFilter
metadata:
  name: namespaces
  labels:
    fluentbit.fluent.io/component: logging
    fluentbit.fluent.io/enabled: 'true'
spec:
  filters:
    - grep:
       # currently you can only do 1 exclude and you can't specify a logical_op
        logicalOp: or
        exclude: $kubernetes['namespace_name'] default
        exclude: $kubernetes['namespace_name'] kube-system

Additional context

The current workaround is multiple grep filters like this:

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFilter
metadata:
  name: namespaces
  labels:
    fluentbit.fluent.io/component: logging
    fluentbit.fluent.io/enabled: 'true'
spec:
  filters:
    - grep:
        exclude: $kubernetes['namespace_name'] default
    - grep:
        exclude: $kubernetes['namespace_name'] kube-system

I'm not sure what the real impact of this discrepancy is.

@cw-Guo cw-Guo added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants