gpt4 book ai didi

elasticsearch - Kibana 5.6.3中的日期范围查询不适用于@timestamp

转载 作者:行者123 更新时间:2023-12-03 01:41:11 25 4
gpt4 key购买 nike

映射:

  "mappings": {
"test-engine": {
"properties": {
"@timestamp": {
"type": "date"
} ....
},

样本记录:
     {
"_index": "application-log",
"_type": "test-engine",
"_id": "AV9pKiMHlm36MlYWarx3",
"_score": 1,
"_source": {
"@timestamp": "2017-10-29T17:24:50.026+0000",
"message": "Initialize connection to node -1 for sending metadata request",
"host": "54.205.134.57",
"severity": "DEBUG",
"thread": "Thread-4",
"logger": "org.apache.kafka.clients.NetworkClient"
}

我尝试过的查询:
     GET application-log/_mapping
{
"range": {
"@timestamp": {
"gte": "2017-10-26T17:24:50.026+0000",
"lte": "2017-10-28T17:24:50.026+0000"
}
}
}

我尝试使用上述映射查询并记录了日期范围在kibana中不起作用

最佳答案

您需要使用_search端点而不是_mapping一个,并将range查询包装在query部分中

 GET application-log/_search
{
"query": {
"range": {
"@timestamp": {
"gte": "2017-10-26T17:24:50.026+0000",
"lte": "2017-10-28T17:24:50.026+0000"
}
}
}
}

关于elasticsearch - Kibana 5.6.3中的日期范围查询不适用于@timestamp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47331557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com