日期范围查询在kibana 5.6.3不@timestamp工作

问题描述 投票:0回答:1

制图:

  "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工作查询

elasticsearch elasticsearch-5 kibana-5
1个回答
1
投票

您需要使用_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"
       }
     }
   }
 }
© www.soinside.com 2019 - 2024. All rights reserved.