# Exclude with pattern matching on a field

**URL:** https://discuss.elastic.co/t/exclude-with-pattern-matching-on-a-field/303942
**Category:** Kibana
**Created:** [May 4, 2022, 12:38pm UTC](https://discuss.elastic.co/t/exclude-with-pattern-matching-on-a-field/303942 "2022-05-04T12:38:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![scrouet](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@scrouet](https://discuss.elastic.co/u/scrouet)
#### Post date: [May 4, 2022, 12:38pm UTC](https://discuss.elastic.co/t/exclude-with-pattern-matching-on-a-field/303942/1 "2022-05-04T12:38:29Z")

</div>

Hello,

I've enabled AppLocker on Windows and I want to exclude some false positive based on a field named `data.win.ruleAndFileData.filePath` when it contains strings like "%OSDRIVE%\USERS\_SAM\_ACCOUNT\_NAME_\APPDATA\LOCAL\TEMP\_SOME\_FIGURE_\GETPATHS.CMD".  
I tried to filter with simple\_query\_string, but it does not work:

```auto
{
  "query": {
    "simple_query_string" : {
        "query": "APPDATA GETPATHS.CMD",
        "fields": ["data.win.ruleAndFileData.filePath"],
        "default_operator": "and"
    }
  }
}

```

---

<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, 2022, 12:38pm UTC](https://discuss.elastic.co/t/exclude-with-pattern-matching-on-a-field/303942/2 "2022-06-01T12:38:51Z")

</div>

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