Uploaded image for project: 'logstash'
  1. logstash
  2. LOGSTASH-430

File input - Windows style paths not supported

    Details

    • Type: Bug/Feature
    • Status: Confirmed (View Workflow)
    • Resolution: Unresolved
    • Affects Version/s: 1.1.0, 1.1.1, 1.1.9, 1.1.10
    • Fix Version/s: bugs

      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

          Hide
          phieber Patrick Hieber added a comment -

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

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

          Show
          phieber Patrick Hieber added a comment - getting the same error even when not specifying any path at all: https://logstash.jira.com/browse/LOGSTASH-1006
          Hide
          tewfik tewfik added a comment - - edited

          I' hitting this too and it is blocking

          Show
          tewfik tewfik added a comment - - edited I' hitting this too and it is blocking
          Hide
          vijay5481 vijay added a comment -

          Any update on this issue,

          Show
          vijay5481 vijay added a comment - Any update on this issue,
          Hide
          jls Jordan Sissel added a comment -

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

          Show
          jls Jordan Sissel added a comment - Still working on this. I'll have it fixed for the next release.
          Hide
          johanhammar Johan Hammar added a comment - - 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

          C:/foo/bar/logstash
          

          instead of

          c:/foo/bar/logstash
          

          If its not try:

          c:/foo/bar/logstash>cd C:\
          C:\>cd foo\bar\logstash
          C:\foo\bar\logstash>
          

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

          Update: Tested on Windows 7 Service pack 1

          Show
          johanhammar Johan Hammar added a comment - - 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 C:/foo/bar/logstash instead of c:/foo/bar/logstash If its not try: c:/foo/bar/logstash>cd C:\ C:\>cd foo\bar\logstash C:\foo\bar\logstash> And it should be possible to start logstash without that nasty error. Update: Tested on Windows 7 Service pack 1

            People

            • Assignee:
              logstash-dev Logstash Developers
              Reporter:
              jpcamara JP Camara
            • Votes:
              7 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated: