通过Logstash 插入文本数据(csv)Elasticsearch

2020-05-29 00:00:00 专区 订阅 斜杠 希望 建立一个
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  file {
# 斜杠千万也写错了,是正斜杠,反斜杠无法导入
    path => ["D:/isee_analyse.csv"]  
    start_position => "beginning"
  }
}
filter {
  csv {
    separator => ","
# 列名
    columns => ["CREATE_TIME","SYS_USER_ROW_ID"]
  }
    mutate {
    convert => {
      "CREATE_TIME" => "string"
      "SYS_USER_ROW_ID" => "string"
    }
  }
 }

output {
  elasticsearch {
        hosts => ["134.96.176.23:23004"]
        index => "test2"
		document_type => "test2"
  }
  stdout { codec => rubydebug }
}

相关文章