0

I am using latest version of Logstash (i.e. 5.4.1) on windows. Logstash fails to start if there are spaces in the path. The command that I am using is as follows:

logstash -f "/C:/Users/folder1/logstash.conf" --path.logs "C:/Users/folder1/logs" --path.settings "/<logstash dir path with spaces>/config"

Following error is generated:

An unexpected error occurred! :error => bad URI(is not URI?): file:////<path with space>/config/log4j2.properties, :backtrace => ["<path with space>/vendor/jruby/lib/ruby/1.9/uri/common.rb:176:in `split'", "<path with space>/vendor/jruby/lib/ruby/1.9/uri/common.rb:210:in `parse'", "<path with space>/vendor/jruby/lib/ruby/1.9/uri/common.rb:747:in `parse'", "<path with space>/vendor/jruby/lib/ruby/1.9/uri/common.rb:994:in `URI'", "<path with space>/logstash-core/lib/logstash/logging/logger.rb:76:in `initialize'", "org/jruby/ext/thread/Mutex.java:149:in `synchronize'", "<path with space>/logstash-core/lib/logstash/logging/logger.rb:74:in `initialize'", "<path with space>/logstash-core/lib/logstash/runner.rb:205:in `execute'", "<path with space>/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "<path with space>/logstash-core/lib/logstash/runner.rb:185:in `run'", "<path with space>/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "<path with space>\\lib\\bootstrap\\environment.rb:71:in `(root)'"]

Any idea, how to deal with this ???

user
  • 383
  • 1
  • 5
  • 20
  • I got this [link](https://stackoverflow.com/questions/41391781/logstash-5-1-1-bad-uriis-not-uri), relevant to this issue, but it is not the solution to this problem. – user Jun 05 '17 at 04:31
  • Seems to use Ruby's URI library. Does it work better if you use %20 instead of a space? – Ben Jun 05 '17 at 04:39
  • No, that does not work. If I replace a space with %20, then that path is ignored (I guess) as following error is generated: `WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults Could not find log4j2 configuration at path ///logstash%205.4.1/config/log4j2.properties. Using default config which logs to console` – user Jun 05 '17 at 04:45
  • If it's changing the message then something is happening differently. Are you sure the config file is there and correct? disclaimer: I don't know anything about logstash, I'm using the Ruby error angle :) – Ben Jun 05 '17 at 05:07
  • @Ben Yes, config file is there and everything works fine if I remove the space from the parent folder (and from the path in the command obviously). – user Jun 05 '17 at 05:13

0 Answers0