Elasticsearch query based on timestamp

那年仲夏 提交于 2021-02-07 11:23:08

问题


This is my elasticsearch query that intends to filter data between 11 pm and 12 pm on the day 2015.08.04. But it doesn't filter and gives many errors.

"query" : {"range" :
            {"@timestamp" :
              {"gt" : "2015-08-04  11:00:00", "lt" : "2015-08-04 12:00:00"} 
            } 
          }  

回答1:


It works with the following query

{
   "query":{
      "range":{
         "@timestamp":{
            "gte":"2015-08-04T11:00:00",
            "lt":"2015-08-04T12:00:00"
         }
      }
   }
}


来源:https://stackoverflow.com/questions/32619909/elasticsearch-query-based-on-timestamp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!