# Logstash deletes log files after processing

**URL:** <https://discuss.elastic.co/t/logstash-deletes-log-files-after-processing/311743>\
**Category:** Logstash\
**Created:** [August 9, 2022, 1:43pm UTC](https://discuss.elastic.co/t/logstash-deletes-log-files-after-processing/311743 "2022-08-09T13:43:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Indrajit](https://avatars.discourse-cdn.com/v4/letter/i/97f17d/32.png) [@Indrajit](https://discuss.elastic.co/u/Indrajit)\
**Post date:** [August 9, 2022, 1:43pm UTC](https://discuss.elastic.co/t/logstash-deletes-log-files-after-processing/311743/1 "2022-08-09T13:43:48Z")

</div>

logstash delete log files after processing. My input follows below. Is there a way to force logstash not to delete files after processing?

```auto
input {

        file {
          path => "/sftpshare/dplogs/dplogs/prod/ext01/routing/MessageSize_SFTP.log.*"
         type => "tran-routing-prod_ext01_vg5"
         sincedb_path => "/webapps/logstash/data/plugins/inputs/file/pr/ext01_routing-hhs-prod-common"
        mode => "read"
        }
}

```

input {  
file {  
path =\>  
"/sftpshare/dplogs/dplogs/prod/ext01/routing/MessageSize\_SFTP.log.\*"  
type =\> "tran-routing-prod\_ext01\_vg5"  
sincedb\_path =\>  
"/webapps/logstash/data/plugins/inputs/file/pr/ext01\_routing-hhs-prod-common"  
mode =\> "read"  
}  
}

---

<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 9, 2022, 3:23pm UTC](https://discuss.elastic.co/t/logstash-deletes-log-files-after-processing/311743/2 "2022-08-09T15:23:34Z")

</div>

> [@Indrajit](#):
>
> Is there a way to force logstash not to delete files after processing?

Set the [file\_completed\_action](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-file_completed_action) option to "log".

---

<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:** [September 6, 2022, 3:24pm UTC](https://discuss.elastic.co/t/logstash-deletes-log-files-after-processing/311743/3 "2022-09-06T15:24:24Z")

</div>

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