# Can I drop events based on the Process Name?

**URL:** <https://community.graylog.org/t/can-i-drop-events-based-on-the-process-name/28085>\
**Category:** Graylog Central (peer support)\
**Tags:** winlogbeat\
**Created:** [March 14, 2023, 11:53am UTC](https://community.graylog.org/t/can-i-drop-events-based-on-the-process-name/28085 "2023-03-14T11:53:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyriakos](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@Kyriakos](https://community.graylog.org/u/Kyriakos)\
**Post date:** [March 14, 2023, 11:53am UTC](https://community.graylog.org/t/can-i-drop-events-based-on-the-process-name/28085/1 "2023-03-14T11:53:38Z")

</div>

Hello,

I am try to configure my WinlogBeat configuration and I have the following issue.  
I try to drop some events based on their processName but it does not work.

I have found the following fields here provided from elastic. I tried all of them but the events do not drop:

> **[Winlogbeat fields | Winlogbeat Reference \[8.6\] | Elastic](https://www.elastic.co/guide/en/beats/winlogbeat/current/exported-fields-winlog.html)**

```auto
- winlog.event_data.NewProcessName
- winlog.event_data.ProcessName
- winlog.event_data.LogonProcessName

Here is my config file:
##########################################
  - name: Security
    event_id: -4672
    processors:
        - drop_event:
            when.and:
                - equals:
                    winlog.event_id: '4799'
                    winlog.event_data.ProcessName: 'C:\Program Files (x86)\BigFix Enterprise\BES Client\BESClient.exe'

```

##################################################  
and here is from server event viewer:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/1/1797048049efcdfa3447e23481e4a27eae58cf7c.png)

Is there any way to filter with CallerProcessName?  
The other way to filter with CallerProcessId but is it dynamically or static? Because I want to use the same configuration file to a lot of servers.

Thanks,

---

<div class="post-metadata">

**Author:** ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)\
**Post date:** [March 14, 2023, 1:50pm UTC](https://community.graylog.org/t/can-i-drop-events-based-on-the-process-name/28085/2 "2023-03-14T13:50:42Z")

</div>

First, Please use the `</>` tool when you post code. yml and config code is very sensitive to spacing and it’s impossible to tell unless you use the Preformatted text tool. Fortunately I can adjust your post for it…  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/f/feabd6b295c3a0766787af0fd4272570b5d80c21.png)

I had a situation similar to yours where I wanted to drop a process name and I seemed to recall it didn’t work… so I switched to regex:

`- regexp.winlog.event_data.ProcessName: 'bigX\.whorlee\.exe$'`

This would catch a process that ends (using the regex end of line `$`) in `bigX.shorlee.exe`

put together with proper indentation and other misc stuff I have in the configuration:

```auto
   - name: Security
     processors:
       - drop_event.when:
           or:
             - equals.winlog.event_id: "1234"
             - equals.winlog.event_id: "5678"
       - drop_event.when:
           and:
             - equals.winlog.event_id: "9102"
             - regexp.winlog.event_data.SubjectUserName: '.*\$$'
       - drop_event.when:
           and:
             - equals.winlog.event_id: "1001"
             - equals.winlog.event_data.SubjectUserName: "BigBrotha"
       - drop_event.when:
           and:
             - equals.winlog.event_id: "0110"
             - equals.winlog.event_data.TargetUserName: "LilBrotha"
             - regexp.winlog.event_data.ProcessName: 'bigX\.whorlee\.exe$'

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [March 28, 2023, 1:51pm UTC](https://community.graylog.org/t/can-i-drop-events-based-on-the-process-name/28085/3 "2023-03-28T13:51:38Z")

</div>

Closed on March 28, 2023, 1:51pm UTC

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