# How to extract filename from file path in filebeat

**URL:** <https://discuss.elastic.co/t/how-to-extract-filename-from-file-path-in-filebeat/46073>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 1, 2016, 3:22pm UTC](https://discuss.elastic.co/t/how-to-extract-filename-from-file-path-in-filebeat/46073 "2016-04-01T15:22:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdaruna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sdaruna/32/7289_2.png) [@sdaruna](https://discuss.elastic.co/u/sdaruna)\
**Post date:** [April 1, 2016, 3:22pm UTC](https://discuss.elastic.co/t/how-to-extract-filename-from-file-path-in-filebeat/46073/1 "2016-04-01T15:22:40Z")

</div>

I am looking to set the output to redis from filebeat.

I need to extract date and name of the file from file path. I knew how to do it using filters in logstash. But, how can i do that with filebeat.?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 2, 2016, 6:51pm UTC](https://discuss.elastic.co/t/how-to-extract-filename-from-file-path-in-filebeat/46073/2 "2016-04-02T18:51:27Z")

</div>

I don't believe that's possible. Filebeat lacks—on purpose—nearly all of Logstash's filtering features.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 3, 2016, 1:55am UTC](https://discuss.elastic.co/t/how-to-extract-filename-from-file-path-in-filebeat/46073/3 "2016-04-03T01:55:45Z")

</div>

Beats are supposed to be lightweight, if you want to do more filtering then that is what LS is for 🙂

---

<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:** [July 5, 2017, 9:53pm UTC](https://discuss.elastic.co/t/how-to-extract-filename-from-file-path-in-filebeat/46073/4 "2017-07-05T21:53:54Z")

</div>


