我正在我的机器上运行ELK。我想在logstash中加载csv文件,以便我可以在Kibana中可视化数据。
当我执行命令bin/logastash -f D:/config/logstash_scaler.config
时,它会给出以下错误。
NoMethodError: undefined method `each_pair' for #<String:0xe82894>
Did you mean? each_char
paths= at D:/Java/Java Support/ELK/jruby- 9.1.12.0/lib/ruby/stdlib/rubygems.rb:395
setup! at D:/Java/Java Support/ELK/logstash- 5.5.2/lib/bootstrap/bundler.rb:52
<main> at D:/Java/Java Support/ELK/logstash- 5.5.2/lib/bootstrap/environment.rb:67
这是我的logstash配置文件
input{
file{
path => "D:/Java/Java Support/ELK/data/scalerloaddata.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
seperator = ","
columns => ["Time","Host","load"]
}
mutate {convert => ["load","float"]}
}
output{
elasticsearch {
host => "localhost"
index => "scaler"
document_type => "scaler_series"
}
stdout{}
}