# Logstash input-\> file-\> path...Why the wildcard \* doesn't work?

**URL:** <https://discuss.elastic.co/t/logstash-input-file-path-why-the-wildcard-doesnt-work/130177>\
**Category:** Logstash\
**Created:** [May 2, 2018, 2:40am UTC](https://discuss.elastic.co/t/logstash-input-file-path-why-the-wildcard-doesnt-work/130177 "2018-05-02T02:40:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cuiyingjia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cuiyingjia/32/30670_2.png) [@cuiyingjia](https://discuss.elastic.co/u/cuiyingjia)\
**Post date:** [May 2, 2018, 2:40am UTC](https://discuss.elastic.co/t/logstash-input-file-path-why-the-wildcard-doesnt-work/130177/1 "2018-05-02T02:40:33Z")

</div>

I tried both on Windows7 and Windows10 , ELK are all latest version.

If the file path is a specific file as below , it works:

```auto
input{
  file {
    path => "C:\PATH\Folder1\Branch1\target.log"
    start_position => "beginning"
  }  
}
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}

```

But if the file path configured with wildcard it doesn't work , no any log pipelined :

```auto
input{
  file {
    path => "C:\PATH\Folder1\Branch1\*log"
    start_position => "beginning"
  }  
}
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}

```

My purpose is finding logs in the recursive children folders with config as following :

```auto
input{
  file {
    path => "C:\PATH\**\*log"
    start_position => "beginning"
  }  
}
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}

```

And my folder structure as below:

```auto
--PATH
    --Folder1
        --Branch1
          --xx.log
          --...
        --Branch2
          --xx.log
          --...
    --Folder2
        --Branch1
          --xx.log
          --...
        --Branch2
          --xx.log
          --...

```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 2, 2018, 6:06am UTC](https://discuss.elastic.co/t/logstash-input-file-path-why-the-wildcard-doesnt-work/130177/2 "2018-05-02T06:06:17Z")

</div>

Try using forward slashes instead of backslashes in your filename pattern.

---

<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 30, 2018, 6:06am UTC](https://discuss.elastic.co/t/logstash-input-file-path-why-the-wildcard-doesnt-work/130177/3 "2018-05-30T06:06:26Z")

</div>

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