我有同样的基本错误信息。
$ bin/logstash -f sample.conf
An unexpected error occurred! :error => bad URI(is not URI?): file:///Users/user_name/Downloads/elastic stack/logstash-5.1.1/config/log4j2.properties, :backtrace => ["/Users/user_name/Downloads/elastic stack/logstash-5.1.1/vendor/jruby/lib/ruby/1.9/uri/common.rb:176:in `split'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/vendor/jruby/lib/ruby/1.9/uri/common.rb:210:in `parse'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/vendor/jruby/lib/ruby/1.9/uri/common.rb:747:in `parse'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/vendor/jruby/lib/ruby/1.9/uri/common.rb:994:in `URI'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/logstash-core/lib/logstash/logging/logger.rb:76:in `initialize'", "org/jruby/ext/thread/Mutex.java:149:in `synchronize'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/logstash-core/lib/logstash/logging/logger.rb:74:in `initialize'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/logstash-core/lib/logstash/runner.rb:193:in `execute'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/logstash-core/lib/logstash/runner.rb:178:in `run'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/Users/user_name/Downloads/elastic stack/logstash-5.1.1/lib/bootstrap/environment.rb:71:in `(root)'"]
事实证明,logstash 不准备处理名称中带有空格的文件路径。好吧,在 macOS 上,我已将它及其关联的弹性堆栈应用程序放在一个名为弹性堆栈的文件夹中(带有空格)。用下划线替换那个空间效果很好。
Path 变成了这样。
~/Downloads/elastic_stack/
现在它按预期启动。