# Processors drop\_event not correct (AND/OR)

**URL:** https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580
**Category:** Beats
**Tags:** packetbeat
**Created:** [May 4, 2017, 2:36pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580 "2017-05-04T14:36:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [May 4, 2017, 2:36pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580/1 "2017-05-04T14:36:09Z")

</div>

Hi,  
I was trying to use this configuration but it's not dropping events:

```
 processors:
    - drop_event:
       when:
        and:
         - not:
            equals:
             dest.ip: "1.2.3.4.5"
         - not:
            equals:
             dest.port: 22

```

essentially, I would like to send to my logstash only the tcp packages where the dest.ip is "1.2.3.4.5" and dest.port is 22.  
What am I doing wrong?

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [May 4, 2017, 2:57pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580/2 "2017-05-04T14:57:24Z")

</div>

Is dest.port a string in the event? If so then it needs to have quotes the config.

Using a custom BPF filter would be more efficient. [https://www.elastic.co/guide/en/beats/packetbeat/current/configuration-interfaces.html#\_bpf\_filter](https://www.elastic.co/guide/en/beats/packetbeat/current/configuration-interfaces.html#_bpf_filter)

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [May 4, 2017, 3:08pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580/3 "2017-05-04T15:08:29Z")

</div>

dest.port is a number. I think it's a problem of my code since if I try this code:

```
processors:
    - drop_event:
        when:
           not:
            equals:
             dest.port: 22

```

it works correctly.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [May 4, 2017, 3:50pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580/4 "2017-05-04T15:50:45Z")

</div>

> [@rschirin](#):
>
> only the tcp packages where the dest.ip is "1.2.3.4.5" and dest.port is 22

I didn't look at logic initally, but that statement would be `!(dest.ip == 1.2.3.4 && dest.port == 22)`.

```auto
processors: 
- drop_event.when.not:
    and:
    - equals.dest.ip: "1.2.3.4"
    - equals.dest.por: 22

```

which I think is the same result as running these two processors:

```auto
processors:
- drop_event.when.not.equals.dest.ip: "1.2.3.4"
- drop_event.when.not.equals.dest.port: 22

```

But again, putting this into a BPF filter would be much better.

```auto
packetbeat.interfaces.bpf_filter: host 1.2.3.4 and port 22

```

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [May 4, 2017, 5:09pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580/5 "2017-05-04T17:09:16Z")

</div>

The logic mechanism that you suspected is exact. I Will try it to give you a feedback,but thank you for the answer.

Personnal note: the syntax with dot char is more clear and easy of indent usage but I didn't find any reference in the 5.3 guide. Was My fault I guess

---

<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: [June 1, 2017, 5:16pm UTC](https://discuss.elastic.co/t/processors-drop-event-not-correct-and-or/84580/6 "2017-06-01T17:16:11Z")

</div>

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