# Plugin to move log files to Processed directory on successful load and to Rejected folder on failure

**URL:** <https://discuss.elastic.co/t/plugin-to-move-log-files-to-processed-directory-on-successful-load-and-to-rejected-folder-on-failure/149770>\
**Category:** Logstash\
**Created:** [September 25, 2018, 5:57am UTC](https://discuss.elastic.co/t/plugin-to-move-log-files-to-processed-directory-on-successful-load-and-to-rejected-folder-on-failure/149770 "2018-09-25T05:57:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GitSpree23](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@GitSpree23](https://discuss.elastic.co/u/GitSpree23)\
**Post date:** [September 25, 2018, 5:57am UTC](https://discuss.elastic.co/t/plugin-to-move-log-files-to-processed-directory-on-successful-load-and-to-rejected-folder-on-failure/149770/1 "2018-09-25T05:57:30Z")

</div>

I am loading new log files from an AWS S3 bucket every hour. I want to maintain a system which will load and process only the new uploads and move them to Processed folder on successful load, and move to Rejected folder on failure.

Is there a plugin to do this? And maintain a log naming the processed files and rejected files.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [September 26, 2018, 1:11am UTC](https://discuss.elastic.co/t/plugin-to-move-log-files-to-processed-directory-on-successful-load-and-to-rejected-folder-on-failure/149770/2 "2018-09-26T01:11:00Z")

</div>

The [`backup_add_prefix`](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html#plugins-inputs-s3-backup_add_prefix) and [`backup_to_bucket`](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html#plugins-inputs-s3-backup_to_bucket) options on the S3 Input plugin may be what you're looking for.

---

<div class="post-metadata">

**Author:** ![GitSpree23](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@GitSpree23](https://discuss.elastic.co/u/GitSpree23)\
**Post date:** [October 4, 2018, 7:03am UTC](https://discuss.elastic.co/t/plugin-to-move-log-files-to-processed-directory-on-successful-load-and-to-rejected-folder-on-failure/149770/3 "2018-10-04T07:03:09Z")

</div>

Is there a way to do the same if I'm using the basic file input plugin?

---

<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:** [November 1, 2018, 7:03am UTC](https://discuss.elastic.co/t/plugin-to-move-log-files-to-processed-directory-on-successful-load-and-to-rejected-folder-on-failure/149770/4 "2018-11-01T07:03:17Z")

</div>

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