# Filebeat Configuration On excluding files

**URL:** <https://discuss.elastic.co/t/filebeat-configuration-on-excluding-files/157314>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 19, 2018, 9:20am UTC](https://discuss.elastic.co/t/filebeat-configuration-on-excluding-files/157314 "2018-11-19T09:20:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguel\_Leite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel_leite/32/41988_2.png) [@Miguel\_Leite](https://discuss.elastic.co/u/Miguel_Leite)\
**Post date:** [November 19, 2018, 9:20am UTC](https://discuss.elastic.co/t/filebeat-configuration-on-excluding-files/157314/1 "2018-11-19T09:20:19Z")

</div>

Hello guys!

I've been trying to fetch some logs from a specific directory, with enumerous logs files... So I tried the following config:

```
- type: log
  enabled: true
  paths:
    - /base/log/*.log
  tags: ["root_log"]

```

Then I exclude some files that I want to parse and treat in a different way, so I did:

```
exclude_files: ['base/log/proc_check\.log']
exclude_files: ['base/log/Debug_Logging\.log']

```

But the problem is that this logs itself are being treated in that specific fetch, as I can see the root\_log tag attached to the events...  
Am I doing anything wrong?

---

<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:** [November 20, 2018, 1:55pm UTC](https://discuss.elastic.co/t/filebeat-configuration-on-excluding-files/157314/2 "2018-11-20T13:55:38Z")

</div>

Hello @Miguel_Leite,

I think there might be a problem with the way you are defining the **exclude\_files** patterns, the option can take multiple regexp or a [regexp can match multiple files](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html#filebeat-input-log-exclude-files).

I think making the following changes would work for you:

```auto
- type: log
  enabled: true
  paths:
    - /base/log/*.log
  tags: ["root_log"]
  exclude_files: ['(proc_check|Debug_Logging).log$']

```

Also, you can start Filebeat in debug mode and see a bit more what is going on.

```auto
filebeat -v -e -d "*"

```

---

<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:** [December 18, 2018, 1:55pm UTC](https://discuss.elastic.co/t/filebeat-configuration-on-excluding-files/157314/3 "2018-12-18T13:55:40Z")

</div>

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