# Beat processor drop fields

**URL:** <https://discuss.elastic.co/t/beat-processor-drop-fields/192213>\
**Category:** Beats\
**Tags:** winlogbeat\
**Created:** [July 25, 2019, 9:42am UTC](https://discuss.elastic.co/t/beat-processor-drop-fields/192213 "2019-07-25T09:42:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajhstn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajhstn/32/24629_2.png) [@ajhstn](https://discuss.elastic.co/u/ajhstn)\
**Post date:** [July 25, 2019, 9:42am UTC](https://discuss.elastic.co/t/beat-processor-drop-fields/192213/1 "2019-07-25T09:42:54Z")

</div>

Hello - what would the best way to "drop all message fields, except for x or y o z"?

I want to start by dropping the message field for all events, but then only include it on a few using a `when.or` condition?

---

<div class="post-metadata">

**Author:** ![ajhstn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajhstn/32/24629_2.png) [@ajhstn](https://discuss.elastic.co/u/ajhstn)\
**Post date:** [July 25, 2019, 9:48am UTC](https://discuss.elastic.co/t/beat-processor-drop-fields/192213/2 "2019-07-25T09:48:31Z")

</div>

can i do something like this?

```
- drop_fields:
  fields:
    message
- add_fields:
    when:
      or:
        - equals: 
            winlog.event_id: 1
        - equals: 
            winlog.event_id: 2
        - equals: 
            winlog.event_id: 3
  fields:
    message
```

---

<div class="post-metadata">

**Author:** ![ajhstn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajhstn/32/24629_2.png) [@ajhstn](https://discuss.elastic.co/u/ajhstn)\
**Post date:** [August 11, 2019, 3:50am UTC](https://discuss.elastic.co/t/beat-processor-drop-fields/192213/3 "2019-08-11T03:50:25Z")

</div>

Any clues on how to drop all message fields by default, except when eventid = 1 or 2 or 3 etc?

---

<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:** [August 12, 2019, 3:16am UTC](https://discuss.elastic.co/t/beat-processor-drop-fields/192213/4 "2019-08-12T03:16:26Z")

</div>

> [@ajhstn](#):
>
> Any clues on how to drop all message fields by default, except when eventid = 1 or 2 or 3 etc?

```auto
processors:
- drop_fields:
    fields: [message]
    when.not.or:
      - equals.winlog.event_id: 1
      - equals.winlog.event_id: 2
      - equals.winlog.event_id: 3

```

Give that a try. I didn't test it myself.

---

<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:** [September 9, 2019, 3:16am UTC](https://discuss.elastic.co/t/beat-processor-drop-fields/192213/5 "2019-09-09T03:16:28Z")

</div>

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