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

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

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

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 :

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 :

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

And my folder structure as below:

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

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

1 Like

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