# Filter when field is missing

**URL:** <https://discuss.elastic.co/t/filter-when-field-is-missing/116719>\
**Category:** Beats\
**Tags:** winlogbeat\
**Created:** [January 23, 2018, 5:14pm UTC](https://discuss.elastic.co/t/filter-when-field-is-missing/116719 "2018-01-23T17:14:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grants](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grants/32/117040_2.png) [@grants](https://discuss.elastic.co/u/grants)\
**Post date:** [January 23, 2018, 5:14pm UTC](https://discuss.elastic.co/t/filter-when-field-is-missing/116719/1 "2018-01-23T17:14:09Z")

</div>

I need to be able to build a drop rule when a filed is missing from the event, I'm not currently able to filter and do not see any conditions that would help with this. Example:

```
processors:
- drop_event.when:
    and:
      - equals.event_id: 800
      - or:
         ## Common
          - equals.event_data.param1: " Microsoft.PowerShell.Core\\Set-StrictMode -Off"
         ## no command / param1 missing
          - equals.event_data.param1: ""

```

I know this can be dropped at Logstash, but I don't even want to send events to Logstash if "param1" is not present in the 800 events.

Can anyone help with some winlogbeat filtering config that could accomplish this task? I think i can do this with a not matches regex with ".\*" but this seems like it would be a performance hit.

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [January 23, 2018, 8:45pm UTC](https://discuss.elastic.co/t/filter-when-field-is-missing/116719/2 "2018-01-23T20:45:43Z")

</div>

We don't have an `exists` conditional, but I think it would make sense to provide one. If you can open an enhancement ticket, we can probably add it for a future version.

In the meantime, if you can get the regexp version to work, I think there shouldn't be a huge performance hit since the regexp won't actually get to run.

---

<div class="post-metadata">

**Author:** ![grants](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grants/32/117040_2.png) [@grants](https://discuss.elastic.co/u/grants)\
**Post date:** [February 1, 2018, 3:55pm UTC](https://discuss.elastic.co/t/filter-when-field-is-missing/116719/3 "2018-02-01T15:55:04Z")

</div>

Where would I open this request or are you talking about a issue on the git page?

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [February 1, 2018, 5:17pm UTC](https://discuss.elastic.co/t/filter-when-field-is-missing/116719/4 "2018-02-01T17:17:03Z")

</div>

Please open a ticket here: [https://github.com/elastic/beats/issues](https://github.com/elastic/beats/issues)

---

<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:** [March 1, 2018, 5:17pm UTC](https://discuss.elastic.co/t/filter-when-field-is-missing/116719/5 "2018-03-01T17:17:08Z")

</div>

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