How to query elasticsearch to get data between two timestamps

Recently I have been using a timestamp based query to get data form my ELK stack and avoid repeats. Now I would like to implement getting information between two specific timestamps.

Here is my current query:

{
  "query": {
    "range": {
      "runtime_timestamp": {
       "gt": "2017-03-18T22:00:55.964Z"
    }  
   }
  },
  "_source": {
  "includes": [
  "field1",
  "field2"
]
},
"sort": [
{
  "@timestamp": {
    "order": "desc"
  }
}
]
}

I have looked at the docs and I can't seem to find a way to do it. Any ideas?

Add also lt or lte in the range query.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.