# Exclude\_Files not working in Filebeat

**URL:** <https://discuss.elastic.co/t/exclude-files-not-working-in-filebeat/275392>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 9, 2021, 7:51am UTC](https://discuss.elastic.co/t/exclude-files-not-working-in-filebeat/275392 "2021-06-09T07:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubham.tawde](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@shubham.tawde](https://discuss.elastic.co/u/shubham.tawde)\
**Post date:** [June 9, 2021, 7:51am UTC](https://discuss.elastic.co/t/exclude-files-not-working-in-filebeat/275392/1 "2021-06-09T07:51:13Z")

</div>

Hi there!  
I have been trying to exclude a file from a directory, here's the dir structure which I have-  
var/logs/domain-a/HSC1/HSC1/logger.log  
var/logs/domain-b/HSC2/HSC2/logger.log  
var/logs/domain-c/HSC3/HSC3/logger.log  
var/logs/domain-d/HSC4/HSC4/logger.log

I want to include the 1st 3 log files (domain-a, b, and c) but not the domain-d file.  
The path that I have written in the filebeat.yml file is -

```auto
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/logs/*/*/*/logger.log
  exclude_files: 
    - '/var/logs/domain-d/HSC4/HSC4/logger.log'

```

Is the above config correct? And is there any way I could do this by exclude\_files or some other method? Thanks

---

<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 7, 2021, 9:52am UTC](https://discuss.elastic.co/t/exclude-files-not-working-in-filebeat/275392/2 "2021-07-07T09:52:04Z")

</div>

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