# Drop event with multi layer conditions not working

**URL:** <https://discuss.elastic.co/t/drop-event-with-multi-layer-conditions-not-working/126644>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 3, 2018, 10:51pm UTC](https://discuss.elastic.co/t/drop-event-with-multi-layer-conditions-not-working/126644 "2018-04-03T22:51:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit\_Vyavahare](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Rohit\_Vyavahare](https://discuss.elastic.co/u/Rohit_Vyavahare)\
**Post date:** [April 3, 2018, 10:51pm UTC](https://discuss.elastic.co/t/drop-event-with-multi-layer-conditions-not-working/126644/1 "2018-04-03T22:51:06Z")

</div>

I have following drop event configuration:

```
- drop_event:
    when:
        or:
          - equals:
              kubernetes.namespace: "monitoring"
          - equals:
              kubernetes.namespace: "kube-public"
          - equals:
              kubernetes.namespace: "abc-system"
          - equals:
              kubernetes.namespace: "default"
          - equals: 
              and:
                - equals:
                    kubernetes.namespace: "kube-system"
                - not:
                    equals:
                      kubernetes.container.name: "nginx-ingress"

```

It is not working for last condition where I want to drop event when kube namespace is kube-system and kube contianer name is not equal to ngnix-ingress.  
Is filebeat can not handle recursive conditions?

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [April 4, 2018, 8:36am UTC](https://discuss.elastic.co/t/drop-event-with-multi-layer-conditions-not-working/126644/2 "2018-04-04T08:36:01Z")

</div>

As the documentation suggests `equals` does not accept conditions, only strings or ints: [https://www.elastic.co/guide/en/beats/filebeat/current/defining-processors.html#condition-equals](https://www.elastic.co/guide/en/beats/filebeat/current/defining-processors.html#condition-equals)

Use `and` instead of `equals`. This basically does the same as you intended but provides correct parameters to every condition.

```auto
- drop_event:
    when:
        or:
          - equals:
              kubernetes.namespace: "monitoring"
          - equals:
              kubernetes.namespace: "kube-public"
          - equals:
              kubernetes.namespace: "abc-system"
          - equals:
              kubernetes.namespace: "default"
          - and: 
              - equals:
                  kubernetes.namespace: "kube-system"
              - not:
                  equals:
                    kubernetes.container.name: "nginx-ingress"

```

---

<div class="post-metadata">

**Author:** ![Rohit\_Vyavahare](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Rohit\_Vyavahare](https://discuss.elastic.co/u/Rohit_Vyavahare)\
**Post date:** [April 4, 2018, 5:17pm UTC](https://discuss.elastic.co/t/drop-event-with-multi-layer-conditions-not-working/126644/3 "2018-04-04T17:17:06Z")

</div>

> [@Rohit\_Vyavahare](#):
>
> - drop\_event:  
> when:  
> or:  
> - equals:  
> kubernetes.namespace: "monitoring"  
> - equals:  
> kubernetes.namespace: "kube-public"  
> - equals:  
> kubernetes.namespace: "abc-system"  
> - equals:  
> kubernetes.namespace: "default"  
> - equals:  
> and:  
> - equals:  
> kubernetes.namespace: "kube-system"  
> - not:  
> equals:  
> kubernetes.container.name: "nginx-ingress"

I tried with your solution it is giving me this error :  
`ERR Error creating prospector: each processor needs to have exactly one action, but found 2 actions`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2018, 5:17pm UTC](https://discuss.elastic.co/t/drop-event-with-multi-layer-conditions-not-working/126644/4 "2018-05-02T17:17:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
