# Csv file is being deleted after process

**URL:** <https://discuss.elastic.co/t/csv-file-is-being-deleted-after-process/184041>\
**Category:** Logstash\
**Created:** [June 3, 2019, 6:45pm UTC](https://discuss.elastic.co/t/csv-file-is-being-deleted-after-process/184041 "2019-06-03T18:45:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [June 3, 2019, 6:45pm UTC](https://discuss.elastic.co/t/csv-file-is-being-deleted-after-process/184041/1 "2019-06-03T18:45:45Z")

</div>

I have a config which reads csv files.  
csv file gets to it's location via rcp from another system once a day.  
but that csv file gets deleted as soon it process reading it. I don't want that to be deleted. how do I do that.

```
input {
        file {
              path => "/data01/csv_files/usage_report*.log"
              sincedb_path => "/dev/null"
              start_position => "beginning"
              mode => "read"
        }
    }

```

csv files are usage\_report\_01.log, usage\_report\_02.log, for day of the week.

---

<div class="post-metadata">

**Author:** ![cknoell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cknoell/32/47353_2.png) [@cknoell](https://discuss.elastic.co/u/cknoell)\
**Post date:** [June 3, 2019, 6:52pm UTC](https://discuss.elastic.co/t/csv-file-is-being-deleted-after-process/184041/2 "2019-06-03T18:52:28Z")

</div>

I think "file\_complete\_action" is the parameter you are looking for. read on here: [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-file\_completed\_action](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-file_completed_action)  
As "delete" is the default here, you should try to another value for "file\_complete\_action".

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [June 3, 2019, 7:06pm UTC](https://discuss.elastic.co/t/csv-file-is-being-deleted-after-process/184041/3 "2019-06-03T19:06:54Z")

</div>

Thanks Christopher. That is exactly what I was looking for

---

<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:** [July 1, 2019, 7:13pm UTC](https://discuss.elastic.co/t/csv-file-is-being-deleted-after-process/184041/4 "2019-07-01T19:13:10Z")

</div>

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