elasticsearch5.5,不同的时间输入格式,怎么在kibana上统一成一种格式展示出来?
Elasticsearch | 作者 王社英 | 发布于2019年04月28日 | 阅读数:1366
下面是我的实验
PUT t4
{
"mappings": {
"p4": {
"properties": {
"date": {
"type": "date" ,
"format": "yyyy-MM-dd HH:mm:ss||strict_date_optional_time||epoch_millis"
}
}
}
}
}
PUT t4/p4/1
{ "date": "2015-01-01" }
PUT t4/p4/2
{ "date": "2015-01-01T12:10:30Z" }
PUT t4/p4/3
{ "date": 1420070400001 }
这些时间数据输入到es后,在kibana展示的还是原来的样子,并没有统一成
yyyy-MM-dd HH:mm:ss
这个格式
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": [
{
"_index": "t4",
"_type": "p4",
"_id": "2",
"_score": 1,
"_source": {
"date": "2015-01-01T12:10:30Z"
}
},
{
"_index": "t4",
"_type": "p4",
"_id": "1",
"_score": 1,
"_source": {
"date": "2015-01-01"
}
},
{
"_index": "t4",
"_type": "p4",
"_id": "3",
"_score": 1,
"_source": {
"date": 1420070400001
}
}
]
}
}
PUT t4
{
"mappings": {
"p4": {
"properties": {
"date": {
"type": "date" ,
"format": "yyyy-MM-dd HH:mm:ss||strict_date_optional_time||epoch_millis"
}
}
}
}
}
PUT t4/p4/1
{ "date": "2015-01-01" }
PUT t4/p4/2
{ "date": "2015-01-01T12:10:30Z" }
PUT t4/p4/3
{ "date": 1420070400001 }
这些时间数据输入到es后,在kibana展示的还是原来的样子,并没有统一成
yyyy-MM-dd HH:mm:ss
这个格式
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": [
{
"_index": "t4",
"_type": "p4",
"_id": "2",
"_score": 1,
"_source": {
"date": "2015-01-01T12:10:30Z"
}
},
{
"_index": "t4",
"_type": "p4",
"_id": "1",
"_score": 1,
"_source": {
"date": "2015-01-01"
}
},
{
"_index": "t4",
"_type": "p4",
"_id": "3",
"_score": 1,
"_source": {
"date": 1420070400001
}
}
]
}
}
1 个回复
zqc0512 - andy zhou
赞同来自: