基于时间戳的Elasticsearch查询 [英] Elasticsearch query based on timestamp

查看:147
本文介绍了基于时间戳的Elasticsearch查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的elasticsearch查询,打算在2015.08.04的晚上11点到12点之间过滤数据.但是它不会过滤,并且会产生很多错误.

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"} 
            } 
          }  

推荐答案

它适用于以下查询

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

这篇关于基于时间戳的Elasticsearch查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆