# Filebeat holding old files in Centos 6.5

**URL:** https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571
**Category:** Beats
**Created:** [September 14, 2017, 3:27pm UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571 "2017-09-14T15:27:52Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Ravikumar\_G](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@Ravikumar\_G](https://discuss.elastic.co/u/Ravikumar_G)
#### Post date: [September 14, 2017, 3:27pm UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/1 "2017-09-14T15:27:52Z")

</div>

Hi not sure it bug but filebeat is killing space on filesystem one I do restart filebeat system get back to normal  
can some one please why filebeat stuck to old files I'm running 5.5.2 version ?

> <https://gist.github.com/inf2ravikumar/0afc7b3f19b570c24cd86f86560d251f>

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [October 4, 2017, 10:10am UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/2 "2017-10-04T10:10:08Z")

</div>

Filebeat is supposed to tail log files. As content can be appended to log files at any time, filebeat keeps the files open for some time, checking for new contents. As log files can be removed/rotated-out, closing the file early can lead to data-loss. That's why the file is kept open.

Have a look at at the different [file closing settings in the docs](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#close-options)

On all OSes a file being deleted is only deleted for sure, once no more process is accessing the file.

---

<div class="post-metadata">

### Author: ![Ravikumar\_G](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@Ravikumar\_G](https://discuss.elastic.co/u/Ravikumar_G)
#### Post date: [October 4, 2017, 3:53pm UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/3 "2017-10-04T15:53:28Z")

</div>

Hi Steffens,

Thanks for your suggestion I have made the filebeat yml below configuration looks my issue is still on going on

root@hostname ~]# df -h  
Filesystem Size Used Avail Use% Mounted on  
/dev/sda3 130G 130G 0 100% /  
tmpfs 95G 5.7M 95G 1% /dev/shm  
/dev/sda1 485M 32M 428M 7% /boot

after filebeat restart

[root@hostname /]# df -h  
Filesystem Size Used Avail Use% Mounted on  
/dev/sda3 130G 106G 18G 86% /  
tmpfs 95G 5.7M 95G 1% /dev/shm  
/dev/sda1 485M 32M 428M 7% /boot (edited)

filebeat yml configuration

- input\_type: log  
paths:

- /opt/trafficserver/var/log/trafficserver/traffic.out  
document\_type: traffic  
close\_renamed : true  
close\_inactive : 10m

- input\_type: log  
paths:

Thanks in advance Ravi

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [October 5, 2017, 9:44am UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/4 "2017-10-05T09:44:00Z")

</div>

Are these files written once or is more contents append at any time?

How big are those files?

How fast are they rotated?

Maybe `10m` is still to big? You can also try `close_eof` to force filebeat to close the file handle every time the end of file is reached. If more contents is added to the file, filebeat will reopen and continue processing.

---

<div class="post-metadata">

### Author: ![Ravikumar\_G](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@Ravikumar\_G](https://discuss.elastic.co/u/Ravikumar_G)
#### Post date: [October 5, 2017, 3:03pm UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/5 "2017-10-05T15:03:46Z")

</div>

> [@steffens](#):
>
> close\_eof

Thanks for your advice Steffens I have made the change this morning will monitor till next 3 days and see if the issue still exists and also my I'm harvesting from 14 sources with individual paths each file is about 30m to 300m which is really huge I know..

Sample configuration now is

- input\_type: log  
paths:

- input\_type: log  
paths:

Thanks / Ravi

---

<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: [October 5, 2017, 3:28pm UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/6 "2017-10-05T15:28:00Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [October 6, 2017, 10:13am UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/7 "2017-10-06T10:13:04Z")

</div>



---

<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 4, 2022, 4:58am UTC](https://discuss.elastic.co/t/filebeat-holding-old-files-in-centos-6-5/100571/8 "2022-11-04T04:58:21Z")

</div>


