# 7.4.2 exclude\_files not workinig

**URL:** <https://discuss.elastic.co/t/7-4-2-exclude-files-not-workinig/244416>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 10, 2020, 2:20pm UTC](https://discuss.elastic.co/t/7-4-2-exclude-files-not-workinig/244416 "2020-08-10T14:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alces](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alces/32/58340_2.png) [@alces](https://discuss.elastic.co/u/alces)\
**Post date:** [August 10, 2020, 2:20pm UTC](https://discuss.elastic.co/t/7-4-2-exclude-files-not-workinig/244416/1 "2020-08-10T14:20:54Z")

</div>

Hello,  
I'm running elk and beats at 7.4.2 and I'm having trouble with the "exclude\_files" config:  
Following are extractions of my filebeat.yml and my system.yml:

```auto
filebeat.yml:

filebeat.inputs:
- type: log
  enabled: false
  paths:
    #/var/log/messages*

---------------------------------
system.yml:

- module: system
  syslog:
    enabled: true
	exclude_files: ['.+\.bz2$']
    var.paths: ["/var/log/messages*"]

```

My goal is to use only the modules for providing the paths filebeat should process.  
I've tried a couple of thing but I can't get this to work. As soon as I copy any logfile to /var/log/messages-narf.bz2 or similar the harvester starts and sends the logfiles to my elk stack.

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [August 10, 2020, 2:59pm UTC](https://discuss.elastic.co/t/7-4-2-exclude-files-not-workinig/244416/2 "2020-08-10T14:59:54Z")

</div>

Hi,

`exclude_files` is an input level option, not module level. Thus, you have to specifiy the option under the `input` namespace.

The correct config is the following:

```auto
- module: system
  syslog:
    enabled: true
    var.paths: ["/var/log/messages*"]
    input:
      exclude_files: ['.+\.bz2$']

```

---

<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 7, 2020, 5:00pm UTC](https://discuss.elastic.co/t/7-4-2-exclude-files-not-workinig/244416/3 "2020-09-07T17:00:19Z")

</div>

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