File input - Windows style paths not supported

Description

When using the file and trying to get all files in C:\myfolder, the following setup will not work.

input {
file {
...
path => "C:\\myfolder
*.log"
...
}
}

The issue seems to come from the use of Dir#glob - https://github.com/jordansissel/ruby-filewatch/blob/master/lib/filewatch/watch.rb#L115

When using Dir.glob, \ is treated as a special character for escaping - http://en.wikipedia.org/wiki/Glob_(programming)#Syntax. The path entered into Logstash appears to be handed in unadultered to FileWatch::Watch, so the Dir.glob call fails to find any results.

The easy fix is to change all paths to unix style, so instead of C:\\myfolder
.log it becomes C:/myfolder/.log (which I like more anyway ). However for a Windows user this would be pretty confusing and there is no indication that the file path is wrong.

Gliffy Diagrams

Activity

Show:

Johan Hammar July 9, 2013 at 11:48 AM
Edited

I found a work around for the "Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (IOError) The filename, directory name, or volume label syntax is incorrect" problem.

Make sure your drive letter is upper case like this

instead of

If its not try:

And it should be possible to start logstash without that nasty error.

Update: Tested on Windows 7 Service pack 1

Jordan Sissel April 30, 2013 at 10:32 PM

Still working on this. I'll have it fixed for the next release.

vijay April 30, 2013 at 1:31 PM

Any update on this issue,

TewfikZ April 25, 2013 at 4:35 PM
Edited

I' hitting this too and it is blocking

Patrick Hieber April 17, 2013 at 7:41 AM

getting the same error even when not specifying any path at all:

https://logstash.jira.com/browse/LOGSTASH-1006

Details

Assignee

Reporter

Fix versions

Affects versions

Created February 21, 2012 at 1:46 PM
Updated February 13, 2015 at 7:18 PM