# Filebeat regex in windows path

**URL:** <https://discuss.elastic.co/t/filebeat-regex-in-windows-path/323927>\
**Category:** Logstash\
**Created:** [January 25, 2023, 2:01pm UTC](https://discuss.elastic.co/t/filebeat-regex-in-windows-path/323927 "2023-01-25T14:01:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon90868141](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@anon90868141](https://discuss.elastic.co/u/anon90868141)\
**Post date:** [January 25, 2023, 2:01pm UTC](https://discuss.elastic.co/t/filebeat-regex-in-windows-path/323927/1 "2023-01-25T14:01:07Z")

</div>

Hi,

I'm trying to collect logs from a windows path with filebeat with filestream as input like so:

```auto
---
# vim:ft=yaml

- type: filestream
  paths:
    - 'C:\Users\*\some\other\folders\*.json'
  fields_under_root: true
  ignore_older: 30m
  close_older: 1h
  scan_frequency: 10s
  parsers:
    - ndjson:
        keys_under_root: true
        expand_keys: true

```

For some reason, this isn't working, though. I think that is because the path is in quotation marks, so the '_' isn't seen as regex, but just as a '_'.  
Is there any workaround or might the reason be something else?  
I guess escaping every backslash could work, but I didn't try this, yet.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [January 25, 2023, 2:06pm UTC](https://discuss.elastic.co/t/filebeat-regex-in-windows-path/323927/2 "2023-01-25T14:06:48Z")

</div>

Try with /

> [@anon90868141](#):
>
> ```auto
> paths:
> - 'C:/Users/*/some/other/folders/*.json'
> 
> ```

---

<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:** [February 22, 2023, 2:07pm UTC](https://discuss.elastic.co/t/filebeat-regex-in-windows-path/323927/3 "2023-02-22T14:07:09Z")

</div>

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