本文使用的Kafka以及ELK搭建过程请见这里
1、定义Elasticsearch模板
{
"index_patterns" : ["test-*"], #匹配test-开头的索引
"mappings" : {
"properties" : {
"code" : {
"type" : "integer"
},
"url" : {
"type"