是否存在es查询或某种方式询问Elasticsearch哪个字段被用作特定索引的时间字段?
答案 0 :(得分:0)
您可以使用Kibana选择正确的时间字段(第5步):
Kibana用户指南:Defining your index patterns
或在索引映射中搜索“类型:日期”的字段
curl 'http://localhost:9200/your_index/_mapping?pretty'
{
"your_index" : {
"mappings" : {
"your_index" : {
"properties" : {
"@**timestamp**" : {
"type" : "date"
},
"@version" : {
"type" : "text"
},
"clock" : {
"type" : "long"
},
"host" : {
"type" : "text"
},
"type" : {
"type" : "text"
}
}
}
}
}
}
或查看索引文档:
curl 'http://localhost:9200/your_index/_search?pretty'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [
{
"_index" : "your_index",
"_type" : "your_index",
"_id" : "logstash-01.kvm.local",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2018-11-10T18:03:22.822Z",
"host" : "logstash-01.kvm.local",
"@version" : "1",
"clock" : 558753,
"type" : "your_index"
}
}
]
}
}