ES: 7.1
问题现象: 不指定index mapping时数据可以入库,但有些数据类型没有正确识别出来,需要转换,所以就手工定义了mapping,定义时没有报错,使用 logstash 重新写入数据,发现es中无数据,一条都没有 请问这是怎么回事,该如何排查,感谢!!!
问题现象: 不指定index mapping时数据可以入库,但有些数据类型没有正确识别出来,需要转换,所以就手工定义了mapping,定义时没有报错,使用 logstash 重新写入数据,发现es中无数据,一条都没有 请问这是怎么回事,该如何排查,感谢!!!
{
"china2020" : { //系统自动生成的mapping
"mappings" : {
"date_detection" : false,
"numeric_detection" : true,
"properties" : {
"@timestamp" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"@version" : {
"type" : "long"
},
"auth" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"host" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"timestamp" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"当日新增" : {
"type" : "long"
},
"日期" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"省份" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"累计" : {
"type" : "long"
},
"颜色" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
#手工定义的 mappin不能用
{
"china2020" : {
"mappings" : {
"date_detection" : true,
"numeric_detection" : true,
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "long"
},
"auth" : {
"type" : "keyword",
"ignore_above" : 256
},
"host" : {
"type" : "keyword",
"ignore_above" : 256
},
"timestamp" : {
"type" : "date"
},
"当日新增" : {
"type" : "long"
},
"日期" : {
"type" : "date"
},
"省份" : {
"type" : "keyword",
"ignore_above" : 256
},
"累计" : {
"type" : "long"
},
"颜色" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
1 个回复
liuxg - Elastic
赞同来自: