一、导入到ES单个字段

cat  json.conf

file {

  path => "/home/mongodb/vsmongo.json"

  type => "myfirst"

  start_position => "beginning"

 

}

}

output {

  if [type] == "myfirst" {

    elasticsearch {

      hosts => ["192.168.3.14:9200"]

      index => "vscontentmongodb-%{+YYYY.MM.dd}"

}

}

}

二、导入json数据到ES

cat  json.conf

file {

  path => "/home/mongodb/vsmongo.json"

  type => "myfirst"

  start_position => "beginning"

  codec => json {

  charset => "UTF-8"

}

}

output {

  if [type] == "myfirst" {

    elasticsearch {

      hosts => ["192.168.3.14:9200"]

      index => "vscontentmongodb-%{+YYYY.MM.dd}"

}

}

}

 posted on 2020-05-20 16:44  xibuhaohao  阅读(599)  评论(0编辑  收藏  举报