# Filter index to last 24h (REST)

**URL:** <https://discuss.elastic.co/t/filter-index-to-last-24h-rest/21665>\
**Category:** Elasticsearch\
**Created:** [January 15, 2015, 5:15pm UTC](https://discuss.elastic.co/t/filter-index-to-last-24h-rest/21665 "2015-01-15T17:15:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mcg](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Mcg](https://discuss.elastic.co/u/Mcg)\
**Post date:** [January 15, 2015, 5:15pm UTC](https://discuss.elastic.co/t/filter-index-to-last-24h-rest/21665/1 "2015-01-15T17:15:24Z")

</div>

Hi all,

Is there any way to only load the last 24 hours of indices? I am trying to  
apply a query to only show the number of documents created over the last 24  
hours (over the REST API), but I have not had too much luck.

Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/07576351-5bea-4f99-af51-16ff76791914%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07576351-5bea-4f99-af51-16ff76791914%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 15, 2015, 5:24pm UTC](https://discuss.elastic.co/t/filter-index-to-last-24h-rest/21665/2 "2015-01-15T17:24:13Z")

</div>

A range filter on a date field with something like from now/d-1 to now/d+1 might work I think.  
If you don’t have a date field (could be a \_timestamp field if you activated it), I’m afraid you can’t do that.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 15 janv. 2015 à 18:15, Matthew [acernuser@gmail.com](mailto:acernuser@gmail.com) a écrit :
> 
> Hi all,
> 
> Is there any way to only load the last 24 hours of indices? I am trying to apply a query to only show the number of documents created over the last 24 hours (over the REST API), but I have not had too much luck.
> 
> Thanks!
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/07576351-5bea-4f99-af51-16ff76791914%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07576351-5bea-4f99-af51-16ff76791914%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/07576351-5bea-4f99-af51-16ff76791914%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/07576351-5bea-4f99-af51-16ff76791914%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0882E33E-371F-4B54-BAF9-CD0BABBD7E6F%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/0882E33E-371F-4B54-BAF9-CD0BABBD7E6F%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:38am UTC](https://discuss.elastic.co/t/filter-index-to-last-24h-rest/21665/3 "2017-07-06T00:38:38Z")

</div>


