# Match log.file.path in Grok

**URL:** https://discuss.elastic.co/t/match-log-file-path-in-grok/177682
**Category:** Logstash
**Created:** [April 20, 2019, 2:24am UTC](https://discuss.elastic.co/t/match-log-file-path-in-grok/177682 "2019-04-20T02:24:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gelinski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gelinski/32/142412_2.png) [@Gelinski](https://discuss.elastic.co/u/Gelinski)
#### Post date: [April 20, 2019, 2:24am UTC](https://discuss.elastic.co/t/match-log-file-path-in-grok/177682/1 "2019-04-20T02:24:05Z")

</div>

How can i get info from log.file.path on grok to input in other custom field?

log.file.path /app/prd1bea/logs/domselftst1prd/mng7node/access.log

Grok (don't working):  
match =\> { "log.file.path" =\> "%{GREEDYDATA:teste}"}

Elastic Stack 7.0

---

<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: [April 20, 2019, 1:24pm UTC](https://discuss.elastic.co/t/match-log-file-path-in-grok/177682/2 "2019-04-20T13:24:25Z")

</div>

If you have a field called log.file.path with periods in the name (rather than [log][file][path]) then that grok should consume the entire field, and is equivalent to copying it.

What do you want in the field teste?

---

<div class="post-metadata">

### Author: ![Gelinski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gelinski/32/142412_2.png) [@Gelinski](https://discuss.elastic.co/u/Gelinski)
#### Post date: [April 20, 2019, 4:31pm UTC](https://discuss.elastic.co/t/match-log-file-path-in-grok/177682/3 "2019-04-20T16:31:48Z")

</div>

The field "log.file.path" is generated by filebeat. But the grok match above is not working to catch that info and insert it into "teste" field.

After resolve that problem, i'll create other grok pattern to catch value "mng7node".

---

<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: [May 18, 2019, 4:31pm UTC](https://discuss.elastic.co/t/match-log-file-path-in-grok/177682/4 "2019-05-18T16:31:54Z")

</div>

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