# How to make dynamic document id from name of the json file

**URL:** <https://discuss.elastic.co/t/how-to-make-dynamic-document-id-from-name-of-the-json-file/222577>\
**Category:** Logstash\
**Created:** [March 7, 2020, 7:54pm UTC](https://discuss.elastic.co/t/how-to-make-dynamic-document-id-from-name-of-the-json-file/222577 "2020-03-07T19:54:35Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [March 7, 2020, 10:57pm UTC](https://discuss.elastic.co/t/how-to-make-dynamic-document-id-from-name-of-the-json-file/222577/4 "2020-03-07T22:57:49Z")

</div>

The full path. If you just want the filename part then you can extract it by copying path to another field and using [mutate+gsub](https://discuss.elastic.co/t/one-or-more-inputs-to-one-or-more-outputs/171906/6) on that.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-make-dynamic-document-id-from-name-of-the-json-file/222577)._
