# Grok filter not parsing path

**URL:** <https://discuss.elastic.co/t/grok-filter-not-parsing-path/248331>\
**Category:** Logstash\
**Created:** [September 11, 2020, 1:26pm UTC](https://discuss.elastic.co/t/grok-filter-not-parsing-path/248331 "2020-09-11T13:26:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renato](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@Renato](https://discuss.elastic.co/u/Renato)\
**Post date:** [September 11, 2020, 1:26pm UTC](https://discuss.elastic.co/t/grok-filter-not-parsing-path/248331/1 "2020-09-11T13:26:11Z")

</div>

Hello,

i would like to retrieve only the name of my log file, but my grok filter doesn't work. When i put it in grok debugger it works without any problems, also logstash doesn't report any error, i just get tag grokparsefailure .

```auto
filter {
    grok {
# break_on_match => false
# match => { "message" => "%{SYSLOG5424SD:logtimestamp} %{GREEDYDATA:errorlog}" }
        match => { "path" => "%{URIPATH}/channel-%{WORD:channel}.log" }

    }
  }

```

My path is (copied from elasticsearch):  
log.file.path /var/logs/channel-SMTH.log

I want my result to be only:  
{  
"channel": "SMTH"  
}

Anyone have any idea what i did wrong?

---

<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:** [September 11, 2020, 1:41pm UTC](https://discuss.elastic.co/t/grok-filter-not-parsing-path/248331/2 "2020-09-11T13:41:47Z")

</div>

You would need to do the match to "[log][file][path]", not just "path".

---

<div class="post-metadata">

**Author:** ![Renato](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@Renato](https://discuss.elastic.co/u/Renato)\
**Post date:** [September 14, 2020, 7:39am UTC](https://discuss.elastic.co/t/grok-filter-not-parsing-path/248331/3 "2020-09-14T07:39:29Z")

</div>

Thank you, it works now.

---

<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:** [October 12, 2020, 7:39am UTC](https://discuss.elastic.co/t/grok-filter-not-parsing-path/248331/4 "2020-10-12T07:39:34Z")

</div>

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