ITPub博客

首页 > IT基础架构 > > 通过Logstash 插入文本数据(csv)Elasticsearch

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

作者:格伯纳 时间:2020-05-29 13:46:14 0 删除 编辑
# 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 }
}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31509949/viewspace-3161547/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
管理员

注册时间:2018-03-30

  • 博文量
    2383
  • 访问量
    984279