# Filebeat not close delete filehandler

**URL:** https://discuss.elastic.co/t/filebeat-not-close-delete-filehandler/304221
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [May 9, 2022, 8:32am UTC](https://discuss.elastic.co/t/filebeat-not-close-delete-filehandler/304221 "2022-05-09T08:32:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mvasilenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvasilenko/32/32886_2.png) [@mvasilenko](https://discuss.elastic.co/u/mvasilenko)
#### Post date: [May 9, 2022, 8:32am UTC](https://discuss.elastic.co/t/filebeat-not-close-delete-filehandler/304221/1 "2022-05-09T08:32:22Z")

</div>

we are running filebeat 6.8.22 with inputs as docker containers and it doesn't release file handlers for deleted files

```auto
filebeat.inputs:
- type: docker
  close_inactive: 5m
  close_removed: true
  clean_removed: true
  containers:
    ids: "*"
    path: /var/lib/docker/containers
    stream: all
  ignore_older: 36h
  json.message_key: log
  json.keys_under_root: false
  json.ignore_decoding_error: true
  scan_frequency: 60s
  document_type: 'docker-logs'
  processors:
  - add_docker_metadata: ~

```

an example from `ps` output

```auto
filebeat 27275 root 5r REG 202,1 100000031 127955205 /var/lib/docker/containers/2839281c157
8e88f15249ba1cad623f48831e7b1972d7ecbb36b1dfc1a0fba69/2839281c1578e88f15249ba1cad623f48831e7b1972d7ecbb36b1dfc1a0fba69-json.l
og.2 (deleted)

```

```auto
lsof -n|grep filebeat|grep delete|wc -l
285

```

this behavior causes extra disk space on EC2 nodes to be used and not properly cleaned up, and eventually, used space is hitting 100% percent and causing `Out of disks space` errors, affecting other containers running at the same EC2 node

any ideas how to fix it? possible quick workaround can be periodic restart for `filebeat` container, but it seems hacky to me

GitHub issue - [filebeat not close delete filehandler · Issue #30472 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/30472)

---

<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: [June 6, 2022, 10:32am UTC](https://discuss.elastic.co/t/filebeat-not-close-delete-filehandler/304221/2 "2022-06-06T10:32:43Z")

</div>

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