# Limit havesters for logging \*.eml

**URL:** <https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 28, 2018, 9:56am UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514 "2018-05-28T09:56:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nacesprin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nacesprin/32/30024_2.png) [@nacesprin](https://discuss.elastic.co/u/nacesprin)\
**Post date:** [May 28, 2018, 9:56am UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514/1 "2018-05-28T09:56:20Z")

</div>

Hello. I want to scan files from directory /email/\*.eml

So, the question is if I will have any problem in the future due to the amount of .eml files in /email/ could it be very big. We know that an .eml file is logged just on the time is created and never more is logged again. So, could it this behaviour throw any type of error on the future with memory related or another issue?

Thanks.

---

<div class="post-metadata">

**Author:** ![nacesprin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nacesprin/32/30024_2.png) [@nacesprin](https://discuss.elastic.co/u/nacesprin)\
**Post date:** [May 28, 2018, 10:16am UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514/2 "2018-05-28T10:16:40Z")

</div>

Will "close\_inactive" option avoid any memory problem since the haverster for each file is closed after 5min?

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [May 28, 2018, 4:43pm UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514/3 "2018-05-28T16:43:06Z")

</div>

@nacesprin I think what you want is [close\_eof](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#close-eof) so we close the harvester as soon as we have read the file. You can also use [harvester\_limit](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#harvester-limit) to limit the number of concurrent harvesters.

---

<div class="post-metadata">

**Author:** ![nacesprin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nacesprin/32/30024_2.png) [@nacesprin](https://discuss.elastic.co/u/nacesprin)\
**Post date:** [May 29, 2018, 8:12am UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514/4 "2018-05-29T08:12:16Z")

</div>

Thanks @pierhugues. Your reply is very useful, but I want to know whether with the "close\_inactive" option is sufficient since only a few of .eml files are created a day. I understand "close\_inactive" free the harvester for each file from memory past 5 minutes of inactivity (default).

I dont want to use "close\_eof" due to the prospector file for .eml files is the same than others \*.log files which are constantly updating.

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [May 29, 2018, 1:09pm UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514/5 "2018-05-29T13:09:18Z")

</div>

@nacesprin What about creating a custom prospector only for \*.eml? You can use wildcards when you define a path, so you could have one prospector watching \*.log and the other \*.eml with different strategies.

---

<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 26, 2018, 1:09pm UTC](https://discuss.elastic.co/t/limit-havesters-for-logging-eml/133514/6 "2018-06-26T13:09:33Z")

</div>

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