# File input in read mode not deleting the file after parsing

**URL:** <https://discuss.elastic.co/t/file-input-in-read-mode-not-deleting-the-file-after-parsing/152053>\
**Category:** Logstash\
**Created:** [October 11, 2018, 1:03pm UTC](https://discuss.elastic.co/t/file-input-in-read-mode-not-deleting-the-file-after-parsing/152053 "2018-10-11T13:03:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshpatri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshpatri/32/36399_2.png) [@rakeshpatri](https://discuss.elastic.co/u/rakeshpatri)\
**Post date:** [October 11, 2018, 1:03pm UTC](https://discuss.elastic.co/t/file-input-in-read-mode-not-deleting-the-file-after-parsing/152053/1 "2018-10-11T13:03:52Z")

</div>

- Version: logstash-input-file (4.1.6)
- Operating System: logstash 6.4.1 image (container)
- Config File:  
input {  
file {  
id =\> "client-files"  
mode =\> "read"  
path =\> ["/usr/share/logstash/plugins/message/\*.gz"]  
add\_field =\> {"[@metadata][test]" =\> "test"}  
start\_position =\> "beginning"  
codec =\> "json"  
file\_completed\_action =\> "delete"  
}  
}  
output {  
stdout {codec =\> rubydebug}  
elasticsearch {  
id =\> "file-data"  
hosts =\> ["elasticsearch:9200"]  
manage\_template =\> false  
template\_name =\> "test"  
index =\> "test"  
}  
}
- Steps to Reproduce:  
i am able to parse data to elasticsearch but the file remains as it's in the folder. Thus when i restart the logstash it reads the file again .  
i am using Kubernetes pods to run logstash.

Please advise if i am missing any configuration.

---

<div class="post-metadata">

**Author:** ![rakeshpatri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rakeshpatri/32/36399_2.png) [@rakeshpatri](https://discuss.elastic.co/u/rakeshpatri)\
**Post date:** [October 12, 2018, 6:33am UTC](https://discuss.elastic.co/t/file-input-in-read-mode-not-deleting-the-file-after-parsing/152053/2 "2018-10-12T06:33:03Z")

</div>

File permission issue was there for which logstash was unable to delete the files from that folder. Now its working fine.

---

<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 9, 2018, 6:33am UTC](https://discuss.elastic.co/t/file-input-in-read-mode-not-deleting-the-file-after-parsing/152053/3 "2018-11-09T06:33:04Z")

</div>

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