# Grok filter working in online debuggers but not in actual implementation

**URL:** <https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428>\
**Category:** Logstash\
**Created:** [May 15, 2023, 8:45am UTC](https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428 "2023-05-15T08:45:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roman-tasi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@roman-tasi](https://discuss.elastic.co/u/roman-tasi)\
**Post date:** [May 15, 2023, 8:45am UTC](https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428/1 "2023-05-15T08:45:02Z")

</div>

This seems to give `_grokparsefailure` a hundred percent of the time:

```auto
if [event][action]=="Process Creation" {
            grok { 
                match => { "winlog.event_data.NewProcessName" => "(?<directory>.*)\\(?<executable>%{DATA:executable}\.exe)" }
            }
        }

```

Yet when I test it in debuggers it seems to be working. Here are some sample field values I have been testing on:

`C:\Windows\SysWOW64\cmd.exe`  
`C:\Windows\System32\wbem\WmiPrvSE.exe`  
`C:\Program Files (x86)\Common Files\Adobe\ARM\1.0\AdobeARM.exe`

Any idea how to fix?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 15, 2023, 4:54pm UTC](https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428/2 "2023-05-15T16:54:33Z")

</div>

It works for me, although I would recommend

```
 "(?<directory>.*)\\(?<executable>%{DATA}\.exe)" 

```

to avoid [executable] being an array like

```
"executable" => [
    [0] "AdobeARM.exe",
    [1] "AdobeARM"
]

```

---

<div class="post-metadata">

**Author:** ![roman-tasi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@roman-tasi](https://discuss.elastic.co/u/roman-tasi)\
**Post date:** [May 15, 2023, 11:08pm UTC](https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428/3 "2023-05-15T23:08:51Z")

</div>

Weird I am trying your adjustment as well but still getting a `_grokparsefailure`

I'm assuming there's some underlying issue here, just not sure how to find it.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [May 17, 2023, 8:35am UTC](https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428/4 "2023-05-17T08:35:10Z")

</div>

Might be issues in old LS versions 7-.

```auto
            grok { 
                match => { "message" => "(?<directory>.*)\\%{DATA:executable}\.exe" }
            }

```

Pure regex:

```auto
            grok { 
                match => { "message" => "(?<directory>.*)\\(?<executable>[^\/]*)\.exe" }
            }

```

Result:

```auto
     "directory" => "C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\1.0",
     "executable" => "AdobeARM"

```

With exe at the end.

```auto
            grok { 
                match => { "message" => "(?<directory>.*)\\%{GREEDYDATA:executable}" }
            }

```

```auto
            grok { 
                match => { "message" => "(?<directory>.*)\\(?<executable>[^\/]*$)" }
            }

```

Result:

```auto
     "directory" => "C:\\Program Files (x86)\\Common Files\\Adobe\\ARM\\1.0",
    "executable" => "AdobeARM.exe"

```

---

<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 14, 2023, 8:35am UTC](https://discuss.elastic.co/t/grok-filter-working-in-online-debuggers-but-not-in-actual-implementation/333428/5 "2023-06-14T08:35:11Z")

</div>

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