# File\_completed\_action =\> "delete" - Works intermittently

**URL:** <https://discuss.elastic.co/t/file-completed-action-delete-works-intermittently/189609>\
**Category:** Logstash\
**Created:** [July 9, 2019, 6:28pm UTC](https://discuss.elastic.co/t/file-completed-action-delete-works-intermittently/189609 "2019-07-09T18:28:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rotem\_lom](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rotem\_lom](https://discuss.elastic.co/u/rotem_lom)\
**Post date:** [July 9, 2019, 6:28pm UTC](https://discuss.elastic.co/t/file-completed-action-delete-works-intermittently/189609/1 "2019-07-09T18:28:37Z")

</div>

Hi There,  
I worked with logstash - 6.7.0 and ES - 6.7.1

I tried to use file\_completed\_action with " delete" and sometimes this action was work well and sometimes not.

Does anyone know how "file\_completed\_action" works?  
Or how can I take care of it that will always be deleted?

Thanks

my logstash conf look like this:

> ```
> input {
> file {
> path => ["/mnt/extracted/*/GeneralInfo.txt", "/mnt/extracted/*/system_overview.txt"]
> start_position => beginning
> codec => multiline{
> pattern => "%{WORD}(%{SPACE}?):(%{SPACE}?)(%{GREEDYDATA}?)"
> negate => true
> what => "previous"
> auto_flush_interval => 1
> }
> mode => "read"
> file_completed_action => "delete"
> type => "general_info"
> }
> }
> 
> filter {
> if [type] == "general_info" {
> grok {
> match => { "message" => "(?<key_info>[^:]*):\s?%{GREEDYDATA:value_info}" }
> }
> grok {
> match => { "path" => "%{GREEDYDATA}/extracted/%{DATA:uuid}/" }
> }
> }
> }
> 
> output {
> if [type] == "general_info" {
> elasticsearch {
> hosts => ["10.208.XX.XX", "10.208.XX.XXX", "10.208.XX.XXX"]
> index => "general_info-%{+YYYY.MM.dd}"
> }
> }
> # stdout {}
> }
> 
> ```

And my pipeline:

> ```
> - pipeline.id: GeneralInfo
> path.config: "/etc/logstash/conf.d/GeneralInfo.txt.conf"
> pipeline.workers: 3
> 
> ```

---

<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:** [August 6, 2019, 6:28pm UTC](https://discuss.elastic.co/t/file-completed-action-delete-works-intermittently/189609/2 "2019-08-06T18:28:49Z")

</div>

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