# Filebeat doesnt exclude rotated files

**URL:** <https://discuss.elastic.co/t/filebeat-doesnt-exclude-rotated-files/226191>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 2, 2020, 9:53am UTC](https://discuss.elastic.co/t/filebeat-doesnt-exclude-rotated-files/226191 "2020-04-02T09:53:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neropointer](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@Neropointer](https://discuss.elastic.co/u/Neropointer)\
**Post date:** [April 2, 2020, 9:53am UTC](https://discuss.elastic.co/t/filebeat-doesnt-exclude-rotated-files/226191/1 "2020-04-02T09:53:56Z")

</div>

I try to grab the log files that only end in .log but Filebeat grabs the rotated logfiles .log.2020-03-11too.  
I dont understand why he does that.

```
-type: log
 enabled: true
 paths:
   - /opt/service/**/service-*.log
 exclude:
   - '^\/opt\/service\/.+\/.+\/.+\/.+(.log).+'
   - '^\/opt\/.+(.backup)\/.+'
   - ['\.jar$']
```

---

<div class="post-metadata">

**Author:** ![Neropointer](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@Neropointer](https://discuss.elastic.co/u/Neropointer)\
**Post date:** [April 8, 2020, 11:58am UTC](https://discuss.elastic.co/t/filebeat-doesnt-exclude-rotated-files/226191/2 "2020-04-08T11:58:34Z")

</div>

Does anybody have any solutions for me?

---

<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:** [May 6, 2020, 11:58am UTC](https://discuss.elastic.co/t/filebeat-doesnt-exclude-rotated-files/226191/3 "2020-05-06T11:58:37Z")

</div>

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