# Read filenames using logstash

**URL:** https://discuss.elastic.co/t/read-filenames-using-logstash/124758
**Category:** Logstash
**Created:** [March 20, 2018, 12:29pm UTC](https://discuss.elastic.co/t/read-filenames-using-logstash/124758 "2018-03-20T12:29:20Z")
**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 21, 2018, 12:26am UTC](https://discuss.elastic.co/t/read-filenames-using-logstash/124758/4 "2018-03-21T00:26:08Z")

</div>

Set the document id as a fingerprint of the fields? See [this thread](https://discuss.elastic.co/t/logstash-fingerprint-plugin-how-to-exclude-timestamp/112498/9) for some ideas on how to do that.

If you do not care about the contents of the file (and you say you just need the name) then using a file input plugin and discarding the contents seems rather wasteful. However, periodically running an ls has the same problem.

You want to be able to say whether you have see the file before. An ignore\_older on the file input might help, but there will be a window for duplicates when logstash restarts. If you do not care about overwriting old entries then that may not be a problem.

If I were doing this on Windows I would write a PowerShell script that listed all items in a directory tree since the last time it had been run, then pipe that into something that could inject into a logstash input. I cannot think of a similar scripted design on Linux off the top of my head.

---

_[View the full topic](https://discuss.elastic.co/t/read-filenames-using-logstash/124758)._
