# Extract file name and add as a field

**URL:** https://discuss.elastic.co/t/extract-file-name-and-add-as-a-field/282105
**Category:** Logstash
**Created:** [August 20, 2021, 5:32pm UTC](https://discuss.elastic.co/t/extract-file-name-and-add-as-a-field/282105 "2021-08-20T17:32:09Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [August 21, 2021, 4:21pm UTC](https://discuss.elastic.co/t/extract-file-name-and-add-as-a-field/282105/2 "2021-08-21T16:21:43Z")

</div>

There are many ways to do this. See [here](https://discuss.elastic.co/t/logtash-adding-filename-as-index-name/131487/2) and [here](https://discuss.elastic.co/t/one-or-more-inputs-to-one-or-more-outputs/171906/6) for examples.

---

_[View the full topic](https://discuss.elastic.co/t/extract-file-name-and-add-as-a-field/282105)._
