# How to GET all events since a certain time

**URL:** <https://discuss.elastic.co/t/how-to-get-all-events-since-a-certain-time/75244>\
**Category:** Logstash\
**Created:** [February 15, 2017, 7:23pm UTC](https://discuss.elastic.co/t/how-to-get-all-events-since-a-certain-time/75244 "2017-02-15T19:23:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Hoffman](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Ben\_Hoffman](https://discuss.elastic.co/u/Ben_Hoffman)\
**Post date:** [February 15, 2017, 7:23pm UTC](https://discuss.elastic.co/t/how-to-get-all-events-since-a-certain-time/75244/1 "2017-02-15T19:23:28Z")

</div>

So currently I am using this POST query to get my data via HTTP:

```
{
"query": {
	"match_all": {}
},
"size": 1,
"sort": [{
	"@timestamp": {
		"order": "desc"
	}
}]
}

```

This get's me the data that I want, but only one at a time. I know that I can increase the size, but then that makes a potential for repeat data. Is there anyway that I can say "Give me all the hits from X time to right now?

I can keep track of the last request that I made in the script that I am writting, so I can just update that every time I make a new POST request.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 15, 2017, 10:11pm UTC](https://discuss.elastic.co/t/how-to-get-all-events-since-a-certain-time/75244/2 "2017-02-15T22:11:03Z")

</div>

Does [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/common-options.html#date-math](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/common-options.html#date-math) help at all?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 15, 2017, 10:11pm UTC](https://discuss.elastic.co/t/how-to-get-all-events-since-a-certain-time/75244/3 "2017-03-15T22:11:28Z")

</div>

Closed on March 15, 2017, 10:11pm UTC

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