# Settings for logging.files for reading from dir then delete files once read

**URL:** <https://discuss.elastic.co/t/settings-for-logging-files-for-reading-from-dir-then-delete-files-once-read/284737>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [September 21, 2021, 2:14pm UTC](https://discuss.elastic.co/t/settings-for-logging-files-for-reading-from-dir-then-delete-files-once-read/284737 "2021-09-21T14:14:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robnew](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@robnew](https://discuss.elastic.co/u/robnew)\
**Post date:** [September 21, 2021, 2:14pm UTC](https://discuss.elastic.co/t/settings-for-logging-files-for-reading-from-dir-then-delete-files-once-read/284737/1 "2021-09-21T14:14:07Z")

</div>

I want to use Filebeat to read from a directory to ingest the log files, then to delete (_sinkhole_) the files once read and ingested into Elasticsearch. Is this achievable with Filebeat?

---

<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:** [September 21, 2021, 10:28pm UTC](https://discuss.elastic.co/t/settings-for-logging-files-for-reading-from-dir-then-delete-files-once-read/284737/2 "2021-09-21T22:28:54Z")

</div>

Welcome to our community! 😃

Filebeat is not currently able to do that unfortunately.  
Logstash can, as mentioned here [File input plugin | Logstash Reference [7.14] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-file_completed_action)

---

<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:** [October 20, 2021, 12:29am UTC](https://discuss.elastic.co/t/settings-for-logging-files-for-reading-from-dir-then-delete-files-once-read/284737/3 "2021-10-20T00:29:27Z")

</div>

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