国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php - logstash寫入資料到elasticsearch 出現(xiàn)資料遺失怎麼解決
歐陽克
歐陽克 2017-07-01 09:11:55
0
1
1189

我日誌裡有600多條資料 但是寫到elasticsearch裡只有300多條
這是什麼原因造成的 有大神知道嘛?
這個(gè)是我的設(shè)定
input {

file {
    path => ["/usr/local/20170730.log"]
    type => "log_test_events"
    tags => ["log_tes_events"]
    start_position => "beginning"
    sincedb_path => "/data/logstash/sincedb/test.sincedb"
    codec => "json"
    close_older => "86400"
    #1 day
    ignore_older => "86400"
}
beats{port => 5044}

}
filter {

urldecode {
    all_fields => true
}

}

output{

   elasticsearch {
      hosts  => "localhost:9200"
      index  => "logstash_%{event_date}"
}

stdout { codec => json }
}

#
歐陽克
歐陽克

溫故而知新,可以為師矣。 博客:www.ouyangke.com

全部回覆(1)
過去多啦不再A夢(mèng)

因?yàn)樽x取日誌的時(shí)候es的模版根據(jù)資料的格式自動(dòng)建立資料型別 例如欄位a的值為int和字串 他所建立的索引第一個(gè)讀取到是數(shù)字就是int型別 索引

修改配置 做映射
output {

      elasticsearch {
        hosts  => "localhost:9200"
        index  => "test1"
        manage_template => true
        template_overwrite => true
        template => "/usr/local/logstash/templates/stat_day.json"
     }
     

stat_day.json模版格式

     {

"order" : 1,
"template" : "test1",
"mappings" : {

 "log_test": {
      "properties" : {
            "event_id": { "type": "string"}
       }
  }

}
}

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板