2

错误:

c:\Program Files\Logstash\bin>logstash.bat -e 'input {stdin {}} output {stdout {}}' 出现意外错误!:Error => bad URI (is not URI?): File: //c:/Program Files/Logstash/config/log4j2.properties,:backtrace => ["C:/Program Files/Logstash/vendor/jruby/ lib/ruby/1.9/uri/common.rb:176:in split'","C:/Program Files/Logstash/vendor/jruby/lib/ruby/1.9/uri/common.rb:210: in parse '","C:/Program Files/Logstash/vendor/jruby/lib/ruby/1.9/uri/common.rb:747:in parse'","C:/Program Files/Logstash/vendor/ jruby/lib/ruby/1.9/uri/common.rb:994:inURI'","c:/Program Files/Logstash/log stash-core/lib/logstash/logging/logger.rb:76:

4

3 回答 3

10

您收到的错误是因为您在 Program Files 中运行 logstash,而 logstash 不适用于文件夹名称中的空格。

您应该将 logstash 文件夹复制到另一个不包含空格的位置并从那里运行它。

于 2016-12-30T21:56:08.887 回答
3

我有同样的基本错误信息。

$ 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/

现在它按预期启动。

于 2017-02-21T11:58:08.217 回答
2

这个错误在 5.0.1 及以后的版本开始出现。在与此相关的 logstash 存储库中存在一个未解决的问题:输入文件路径有时在 Windows 上无法解析。您可以使用5.0.0版本,而此错误未修复。

于 2017-02-07T02:24:45.180 回答