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

Filtering events before dumping them on stdout of the exporter #169

Open
sivarama-p-raju opened this issue Jun 16, 2024 · 2 comments
Open

Comments

@sivarama-p-raju
Copy link

Could someone please let me know if there is a possibility of filtering events and dropping specific events before the rest of the events are dumped on stdout of the exporter ?

For example, I would like to drop all events with reason equals "PolicyApplied" as there are tons of these events and I would like to avoid on the stdout.

I am not sure if a rule can be created at a cluster scope level to achieve this ?

Below might be an example:

apiVersion: events.kubesphere.io/v1alpha1
kind: Rule
metadata:
  labels:
    kubesphere.io/rule-scope: cluster
  name: drop-specific-events
  namespace: test
spec:
  rules:
  - condition: |
      reason == "PolicyApplied"
    enable: true
    name: DropPolicyApplied
    type: drop

I have tried Kubernetes event exporter (resmoio/kubernetes-event-exporter) as well, and there are possibilities of dropping specific events before dumping the rest of the events to a receiver (stdout for example). However, there are some challenges with that as I was unable to figure out a way to drop events with specific name (using wildcards) and also to print the last timestamp of the event.

"kubesphere/kube-events" prints the last timestamp, which is exactly what I wanted. The only thing I need help with is to identify a way to filter the events by dropping specific events with reason, or name etc.

Thanks a lot in advance.

@benjaminhuo
Copy link
Member

@junotx @wanjunlei

@benjaminhuo
Copy link
Member

  • condition: |
    reason == "PolicyApplied"
    enable: true
    name: DropPolicyApplied
    type: drop

Drop a specific event is a good idea, @junotx @wanjunlei @Gentleelephant

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

No branches or pull requests

2 participants