直接运行
bin/logstash -e 'input{stdin{}}output{stdout{codec=>rubydebug}}'
成功,输入后有输出。
但是输出到 elasticsearch 就报错了
bin/logstash -f logstash.config
一段时间没有响应,并在报错后结束进程。
报错如下:
An unexpected error occurred! {:error=>#<ArgumentError: Setting "" hasn't been registered>, :backtrace=>["/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/settings.rb:29:in get_setting'", "/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/settings.rb:61:in
set_value'", "/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/settings.rb:80:in merge'", "org/jruby/RubyHash.java:1342:in
each'", "/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/settings.rb:80:in merge'", "/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/settings.rb:115:in
validate_all'", "/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/runner.rb:210:in execute'", "/data/logstash/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in
run'", "/data/logstash/logstash-5.2.2/logstash-core/lib/logstash/runner.rb:183:in run'", "/data/logstash/logstash-5.2.2/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in
run'", "/data/logstash/logstash-5.2.2/lib/bootstrap/environment.rb:71:in `(root)'"]}
logstash.config 配置内容如下:
input{
stdin { }
}
output{
elasticsearch {
host => "127.0.0.1:7101"
index => "logstash_test"
flush_size => 2000
idle_flush_time => 5
}
}
查过 elasticsearch,并没有数据进来。而且输入的数据明显没有发送出去,在报错后,才在命令行被获取
host是logstash早期的语法,改为hosts也不行。
logstash、elasticsearch版本都是5.2.2
logstash.yml的配置是默认的,全被注释掉了,只有日志位置 [path.logs:/data/logstash/logs ] 被我改了一下
# ------------ Debugging Settings --------------
#
# Options for log.level:
# * fatal
# * error
# * warn
# * info (default)
# * debug
# * trace
#
# log.level: info
path.logs:/data/logstash/logs
#
1
vebuqi 2017-11-01 23:32:29 +08:00 via Android
贴下你的 logstash.yml
|
2
Phant0m 2017-11-01 23:34:14 +08:00
host => "127.0.0.1:7101" 改成 hosts => "127.0.0.1:7101" 少了一个 s
|
3
shiji 2017-11-02 04:20:18 +08:00
楼上说的对
|
6
vebuqi 2017-11-02 10:35:22 +08:00
感觉像是读配置文件读错了,或者没读到
试试用 --path-setting 配置文件目录 参数启动一下 或者 output 里先不往 es 里打,只写 stdout { codec => rubydebug } |
7
DO3956 OP @vebuqi
忘了说了,每次启动都会有这个警告 OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N。 非常奇怪的事情,我现在运行 bin/logstash -e 'input{stdin{}}output{stdout{codec=>rubydebug}}' 也没有数据返回了 然后重新下了 5.2.0 的版本,第一次运行 bin/logstash -e 'input{stdin{}}output{stdout{codec=>rubydebug}}' 成功 再运行就一直没有返回,也没有错误 |
9
linhan0816 2020-02-25 17:57:42 +08:00
我也遇到了这个错误,是 logstash.yml 配置原因,path.logs:/data/logstash/logs,冒号之后需要有一个空格,要写成 path.logs: /data/logstash/logs。
|