CSV文件中的Logstash数据导入错误

时间:2020-05-21 15:12:11

标签: elasticsearch logstash

我的程序是:

input {
   file {
      path = "/root/Documents/mobility-trends.csv"
      start_position = "beginning"
      sincedb_path = "/dev/null"
   }
}
filter {
     csv {
         separator = ","
         columns = ["geo_type","region","transportation_type","date","value"]
       }
}
output {
     elasticsearch {
          hosts = "http://localhost:9200"
          index = "mobility_2019"
      }
      stdout  {}
}

执行后的错误是:

:exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \\t\\r\\n], \"#\", \"=>\" at line 3, column 12 (byte 30) after input {\n   file {\n      path ", :backtrace=>["/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperative'", "/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2580:in `map'", "/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:161:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in `initialize'", "/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/java_pipeline.rb:27:in `initialize'", "/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/pipeline_action/create.rb:36:in `execute'", "/root/Documents/logstash-7.6.2/logstash-core/lib/logstash/agent.rb:326:in `block in converge_state'"]}
[2020-05-21T20:32:14,963][INFO ][logstash.runner          ] Logstash shut down.

0 个答案:

没有答案
相关问题