# Logstash doesn't remove proceed gz files

**URL:** <https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347>\
**Category:** Logstash\
**Created:** [December 22, 2020, 8:21am UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347 "2020-12-22T08:21:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowline](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@snowline](https://discuss.elastic.co/u/snowline)\
**Post date:** [December 22, 2020, 8:21am UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347/1 "2020-12-22T08:21:07Z")

</div>

I've setup logstash as file reader for \*.gz log files in "read" mode.  
These files are copied from remote server to local folders every 15 minutes under user logstash.

Files and folders have owner "logstash" and mode - 0644.

What i observer, that logstash is reading files, write them to since\_db but not removing.  
Also there are subfolders with month and date in parent folder.

Example: /opt/logstash/remote\_logs/12/22/log.gz

```auto
   file {
        path => ["/opt/logstash/remote_logs/**/*.gz"]
        sincedb_path => "/etc/logstash/conf.d/filereader/since_remote.db"
        mode => "read"
   }

```

Also i didn't get any errors in logstash-plain.log regarding logstash cannot remove file.

Logstash version is: 7.10.0

Please advise how to solve this problem.

Thank you.

---

<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:** [December 22, 2020, 8:47am UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347/2 "2020-12-22T08:47:06Z")

</div>

What do you mean by remove here, are you expecting Logstash to delete them?

---

<div class="post-metadata">

**Author:** ![snowline](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@snowline](https://discuss.elastic.co/u/snowline)\
**Post date:** [December 22, 2020, 10:05am UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347/3 "2020-12-22T10:05:42Z")

</div>

Yes, i want to delete files after they will be proceed by logstash.

---

<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:** [December 22, 2020, 9:40pm UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347/4 "2020-12-22T21:40:04Z")

</div>

You need to set [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)

---

<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:** [December 22, 2020, 9:46pm UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347/5 "2020-12-22T21:46:11Z")

</div>

Can you enable log.level debug and see if it goes through the [deletable file handling](https://github.com/logstash-plugins/logstash-input-file/blob/871e40e18348d5ec1ceb8f92ec442bb3f36c13f6/lib/logstash/inputs/file.rb#L380)?

---

<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:** [January 19, 2021, 9:46pm UTC](https://discuss.elastic.co/t/logstash-doesnt-remove-proceed-gz-files/259347/6 "2021-01-19T21:46:15Z")

</div>

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