# Filebeat auto-deletion of files when harvesting of files complete or remove log file older than 7 days

**URL:** https://discuss.elastic.co/t/filebeat-auto-deletion-of-files-when-harvesting-of-files-complete-or-remove-log-file-older-than-7-days/164034
**Category:** Beats
**Tags:** filebeat
**Created:** [January 13, 2019, 12:10pm UTC](https://discuss.elastic.co/t/filebeat-auto-deletion-of-files-when-harvesting-of-files-complete-or-remove-log-file-older-than-7-days/164034 "2019-01-13T12:10:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Saurabh\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Saurabh\_Sharma1](https://discuss.elastic.co/u/Saurabh_Sharma1)
#### Post date: [January 13, 2019, 12:10pm UTC](https://discuss.elastic.co/t/filebeat-auto-deletion-of-files-when-harvesting-of-files-complete-or-remove-log-file-older-than-7-days/164034/1 "2019-01-13T12:10:10Z")

</div>

I am facing one critical issue with filebeat, There too much logs available in my log directory, How can I delete the logs older than 7 days

---

<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: [January 13, 2019, 10:08pm UTC](https://discuss.elastic.co/t/filebeat-auto-deletion-of-files-when-harvesting-of-files-complete-or-remove-log-file-older-than-7-days/164034/2 "2019-01-13T22:08:46Z")

</div>

You need to use something other than FIlebeat for this.

---

<div class="post-metadata">

### Author: ![Debashis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debashis/32/45290_2.png) [@Debashis](https://discuss.elastic.co/u/Debashis)
#### Post date: [January 17, 2019, 10:03am UTC](https://discuss.elastic.co/t/filebeat-auto-deletion-of-files-when-harvesting-of-files-complete-or-remove-log-file-older-than-7-days/164034/3 "2019-01-17T10:03:23Z")

</div>

Hi @Saurabh_Sharma1,

Do you want to delete the log files or you want to ignore harvesting those files which are older than 7 days?

If you want to ignore you can do it using "ignore\_older" parameter

Thanks

---

<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: [February 14, 2019, 10:10am UTC](https://discuss.elastic.co/t/filebeat-auto-deletion-of-files-when-harvesting-of-files-complete-or-remove-log-file-older-than-7-days/164034/4 "2019-02-14T10:10:04Z")

</div>

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