私は、弾性のファイルにCSVファイルをインポートしようとしていますが、それは失敗し、エラー投げました
パイプラインがエラーに起因中止{:pipeline_id => "メイン"、:例外=>#、:バックトレース=> [ "は/ usr / local /セラー/ logstash / 7.6.1 / libexecに/ベンダー/バンドル/ JRubyの/ 2.5.0 /gems/logstash-filter-mutate-3.5.0/lib/logstash/filters/mutate.rb:222:in
block in register'", "org/jruby/RubyHash.java:1428:in
/usr/local/Cellar/logstash/7.6.1/libexec/vendor/bundle/ "" 'は、それぞれJRubyの/ 2.5.0 /宝石/ logstash-フィルタのmutate-3.5.0 / libに/ logstash /フィルター/ mutate.rb:220:でregister'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:56:in
レジスタ" "" /usr/local/Cellar/logstash/7.6.1/libexec /logstash-core/lib/logstash/java_pipeline.rb:200:inblock in register_plugins'", "org/jruby/RubyArray.java:1814:in
:各「 "" /usr/local/Cellar/logstash/7.6.1/libexec/logstash-core/lib/logstash/java_pipeline.rb:199中register_plugins'", "/usr/local/Cellar/logstash/7.6.1/libexec/logstash-core/lib/logstash/java_pipeline.rb:502:in
maybe_setup_out_plugins' "" /usr/local/Cellar/logstash/7.6.1/libexec/logstash-core/lib/logstash/java_pipeline.rb:212:instart_workers'", "/usr/local/Cellar/logstash/7.6.1/libexec/logstash-core/lib/logstash/java_pipeline.rb:154:in
実行 "」、 "開始中/usr/local/Cellar/logstash/7.6.1/libexec/logstash-core/lib/logstash/java_pipeline.rb:109:in `ブロック""]、 "pipeline.sources"=> 【 "/Users/user/Document/Esk-Data/xudaxia.conf"]:スレッド=> "#"}
以下はあるのconfファイルには、
input
{
file{
path => ["/test.csv"]
start_position => "beginning"
}
}
filter{
csv{
separator => ","
columns => ["comment_time","comment", "id", "video_time"]
}
mutate{
convert => {
"comment_time" => "date_time"
"comment" => "string"
"id" => "integer"
"video_time" => "float"
}
}
}
output{
elasticsearch{
hosts => ["localhost:9200"]
index => "test"
}
}
test.CSV
comment_time comment id video_time
2020/03/22 15:59:41 バイ a 123.100
2020/03/22 15:59:45 บาย b 100.100
2020/04/22 15:59:50 ByeBye c 80.210
誰の助けができますか?
ドキュメントをよるとオプションは、date_time
上の変換動作のために存在していないmutate
ドキュメントを-プラグインこちら。しかし、このプラグインは、それはあなたのユースケースではないことを、別の一つにタイプをキャストするために使用されます。場合はcomment_time
、日付フィールドとして認識されていないあなたがそれをtrasformすべきdate
ドキュメントを-プラグインこちら。
だから、このブロックを削除する必要があります。
mutate{
convert => {
"comment_time" => "date_time"
"comment" => "string"
"id" => "integer"
"video_time" => "float"
}
}
そしてこのものと交換してください:
date {
match => [ "comment_time", "yyyy/MM/dd HH:mm:ss"
}