# Can you exclude subfolder from being crawled completely in filebeat?

**URL:** <https://discuss.elastic.co/t/can-you-exclude-subfolder-from-being-crawled-completely-in-filebeat/381127>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 19, 2025, 8:25am UTC](https://discuss.elastic.co/t/can-you-exclude-subfolder-from-being-crawled-completely-in-filebeat/381127 "2025-08-19T08:25:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [August 19, 2025, 9:56am UTC](https://discuss.elastic.co/t/can-you-exclude-subfolder-from-being-crawled-completely-in-filebeat/381127/2 "2025-08-19T09:56:08Z")

</div>

Hello @WERTYASDFGH

Welcome to the community!!

As per below blog try without using ^ as you are providing absolute path :

> [@Regex not worked with filebeat](https://discuss.elastic.co/t/regex-not-worked-with-filebeat/351901):
>
> Hi Dear, I'm trying to exclude any files starting with gc but below regex did not work and regex is verified, myfilebeat version is :8.3.2 filebeat.inputs: # Each - is an input. Most options can be set at the input level, so # you can use different inputs for various configurations. # Below are the input specific configurations. # filestream is an input for collecting log messages from files. - type: filestream # Unique ID among all inputs, an ID is required. id: my-filestream-id # …

Thanks!!

---

_[View the full topic](https://discuss.elastic.co/t/can-you-exclude-subfolder-from-being-crawled-completely-in-filebeat/381127)._
