Pooja
Pooja

Reputation: 883

Elasticsearch query based on timestamp

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

Upvotes: 19

Views: 53929

Answers (1)

Pooja
Pooja

Reputation: 883

It works with the following query

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

Upvotes: 52

Related Questions