# Logstash and drop filter for Windows event

**URL:** <https://discuss.elastic.co/t/logstash-and-drop-filter-for-windows-event/106322>\
**Category:** Logstash\
**Created:** [November 3, 2017, 2:14pm UTC](https://discuss.elastic.co/t/logstash-and-drop-filter-for-windows-event/106322 "2017-11-03T14:14:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kernelpanic](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@kernelpanic](https://discuss.elastic.co/u/kernelpanic)\
**Post date:** [November 3, 2017, 2:14pm UTC](https://discuss.elastic.co/t/logstash-and-drop-filter-for-windows-event/106322/1 "2017-11-03T14:14:20Z")

</div>

Hello, I'm trying to drop events using the following filter but its not working:

> if [event\_id] == 4658 and [event\_data.ProcessName] == "C:\Windows\System32\CpqMgmt\cqmghost/cqmghost.exe" {  
> drop {}  
> }

I've tried using double slashes '\' and using forward slashes in the path but the event is till appearing in the index - can anyone tell me where I'm going wrong?

Thanks.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 6, 2017, 6:23am UTC](https://discuss.elastic.co/t/logstash-and-drop-filter-for-windows-event/106322/2 "2017-11-06T06:23:25Z")

</div>

Two potential problems:

- The `event_id` field is a string and you're comparing it to an integer.
- The `ProcessName` field is nested under `event_data` and you're using the wrong syntax for nested fields. See [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references).

---

<div class="post-metadata">

**Author:** ![kernelpanic](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@kernelpanic](https://discuss.elastic.co/u/kernelpanic)\
**Post date:** [November 6, 2017, 11:49am UTC](https://discuss.elastic.co/t/logstash-and-drop-filter-for-windows-event/106322/3 "2017-11-06T11:49:42Z")

</div>

Hello, event\_id is a number type in my index so when I've dropped other events for example [event\_id] == "1234" did not work, I had to remove the quotes before it would drop the events.

I've managed to drop the event just by using event ID and computer name, I didn't know about nested fields though, thanks for the info.

---

<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:** [December 4, 2017, 11:49am UTC](https://discuss.elastic.co/t/logstash-and-drop-filter-for-windows-event/106322/4 "2017-12-04T11:49:45Z")

</div>

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