# Is it possible to do a "tail" query on an index? (find the newest entries?)

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-do-a-tail-query-on-an-index-find-the-newest-entries/15293>\
**Category:** Elasticsearch\
**Created:** [January 17, 2014, 8:59am UTC](https://discuss.elastic.co/t/is-it-possible-to-do-a-tail-query-on-an-index-find-the-newest-entries/15293 "2014-01-17T08:59:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steinar\_Bang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steinar_bang/32/122285_2.png) [@Steinar\_Bang](https://discuss.elastic.co/u/Steinar_Bang)\
**Post date:** [January 17, 2014, 8:59am UTC](https://discuss.elastic.co/t/is-it-possible-to-do-a-tail-query-on-an-index-find-the-newest-entries/15293/1 "2014-01-17T08:59:22Z")

</div>

Is it possible to do a "tail"-like query on an ES index? Ie. find the  
newest entries, when I don't know the time stamp of the indexed items?

(It's actually the time stamp I'm looking for, as well as the actual  
data indexed at that point in time)

Thanks!

- Steinar

--  
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/upzcvbxj6l1x.fsf%40dod.no](https://groups.google.com/d/msgid/elasticsearch/upzcvbxj6l1x.fsf%40dod.no).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 17, 2014, 9:03am UTC](https://discuss.elastic.co/t/is-it-possible-to-do-a-tail-query-on-an-index-find-the-newest-entries/15293/2 "2014-01-17T09:03:30Z")

</div>

You need to activate it in mapping: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html#mapping-timestamp-field](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html#mapping-timestamp-field)

Then you should be able to query and order by this field.

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

Le 17 janvier 2014 at 09:59:17, Steinar Bang (sb@dod.no) a écrit:

Is it possible to do a "tail"-like query on an ES index? Ie. find the  
newest entries, when I don't know the time stamp of the indexed items?

(It's actually the time stamp I'm looking for, as well as the actual  
data indexed at that point in time)

Thanks!

- Steinar

--  
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/upzcvbxj6l1x.fsf%40dod.no](https://groups.google.com/d/msgid/elasticsearch/upzcvbxj6l1x.fsf%40dod.no).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/etPan.52d8f1e2.3a95f874.dc5%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52d8f1e2.3a95f874.dc5%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:56am UTC](https://discuss.elastic.co/t/is-it-possible-to-do-a-tail-query-on-an-index-find-the-newest-entries/15293/3 "2017-07-06T01:56:11Z")

</div>


