# Filebeat: initial ingestion of 2M files

**URL:** <https://discuss.elastic.co/t/filebeat-initial-ingestion-of-2m-files/282362>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 24, 2021, 2:34pm UTC](https://discuss.elastic.co/t/filebeat-initial-ingestion-of-2m-files/282362 "2021-08-24T14:34:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baygon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baygon/32/91792_2.png) [@Baygon](https://discuss.elastic.co/u/Baygon)\
**Post date:** [August 24, 2021, 2:34pm UTC](https://discuss.elastic.co/t/filebeat-initial-ingestion-of-2m-files/282362/1 "2021-08-24T14:34:48Z")

</div>

I have about 2M log files to process for initial ingestion.  
These csv files are spread on 4 folders.  
I have set up a filebeat pipeline and set `harvester_limit: 0`

I have also tried to set up 4 filebeat instances, modify the ulimit to 500000 (I dont seem to be able to do more), but still same issue.

After harvesting for a bit (maybe 20s) filebeat throws error that too many files are opened.  
How would you go around that?

EDIT: though this problem is for a initial load, it might anyway come later. The logs generation is around 30k files per hour.  
I am setting:

```auto
  clean_removed: true
  scan_frequency: 300s
  ignore_older: 350s
  clean_inactive: 800s

```

but still within these 800s I might accumulate a significant amount of logs files

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [August 25, 2021, 12:43am UTC](https://discuss.elastic.co/t/filebeat-initial-ingestion-of-2m-files/282362/2 "2021-08-25T00:43:42Z")

</div>

Set the `close_eof: true`. [Log input | Filebeat Reference [7.14] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#filebeat-input-log-close-eof) that way the harvesters will stop as it moves to the next files instead of just staying open indefinitely.

---

<div class="post-metadata">

**Author:** ![Baygon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baygon/32/91792_2.png) [@Baygon](https://discuss.elastic.co/u/Baygon)\
**Post date:** [August 25, 2021, 1:03am UTC](https://discuss.elastic.co/t/filebeat-initial-ingestion-of-2m-files/282362/3 "2021-08-25T01:03:35Z")

</div>

> [@legoguy1000](#):
>
> close\_eof: true

This totally makes sense. Most of the files have very little content inside, that is working just fine now!

---

<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:** [September 22, 2021, 3:04am UTC](https://discuss.elastic.co/t/filebeat-initial-ingestion-of-2m-files/282362/4 "2021-09-22T03:04:00Z")

</div>

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