# File - failed to open fichier1.log: Unhandled IOException: java.io.IOException: unhandled errno: Too many open files

**URL:** <https://discuss.elastic.co/t/file-failed-to-open-fichier1-log-unhandled-ioexception-java-io-ioexception-unhandled-errno-too-many-open-files/136825>\
**Category:** Logstash\
**Created:** [June 21, 2018, 10:26am UTC](https://discuss.elastic.co/t/file-failed-to-open-fichier1-log-unhandled-ioexception-java-io-ioexception-unhandled-errno-too-many-open-files/136825 "2018-06-21T10:26:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyl](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@dyl](https://discuss.elastic.co/u/dyl)\
**Post date:** [June 21, 2018, 10:26am UTC](https://discuss.elastic.co/t/file-failed-to-open-fichier1-log-unhandled-ioexception-java-io-ioexception-unhandled-errno-too-many-open-files/136825/1 "2018-06-21T10:26:43Z")

</div>

Hey,

I use logstash to analyse files and drop those which not interest me.

I currently listen : /data/mypath/\*.log  
But this path contains nearly 15.000 files and I need to analyse them.

So that's why when I launch my pipeline i've got this error :

`[WARN] 2018-06-21 12:23:06.485 [[main]<file] file - failed to open /home/D_NT_UEM/petotadm/batch/WKF999-20180620-20180620-1951-29-722-721-51-2-188241890-20180620-195208.log: Unhandled IOException: java.io.IOException: unhandled errno: Too many open files`

and this message for each files in the directory. Can I set a limit to open all these files ?

My pipeline :

```
input
{
  file
  {
    path => "/data/mypath/*.log"
    type => "GDAlogATrier"
        codec => multiline { pattern => "anepastrouver" negate => true what => "previous" auto_flush_interval => 1 max_lines => 45000 }
  }
}

filter
{
 if [message] =~ "CODE RETOUR : 0"
 {
   drop { }
 }
 if [message] =~ "CODE RETOUR : -4"
 {
   if [message] !~ "MNOR" and [message] !~ "TECH" and [message] !~ "FTAL"
   {
     drop { }
   }
 }
 fingerprint
 {
    source => ["message"]
    target => "fingerprint_id"
    method => "MURMUR3"
 }
}

output
{
  file
  {
    codec => line
    {
      format => "%{[message]}"
    }
    path => "/data/FLD/ELK/workload/trie-%{[fingerprint_id]}.log"
  }
  stdout { codec => rubydebug }
}

```

Thanks to this pipeline I filter my directory and obtains just interest files in output.

Thx for answer

---

<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:** [July 19, 2018, 10:26am UTC](https://discuss.elastic.co/t/file-failed-to-open-fichier1-log-unhandled-ioexception-java-io-ioexception-unhandled-errno-too-many-open-files/136825/2 "2018-07-19T10:26:44Z")

</div>

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