# View last indexed data on elasticsearch

**URL:** https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612
**Category:** Elasticsearch
**Created:** [September 27, 2016, 1:57pm UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612 "2016-09-27T13:57:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ANU\_SARA\_VARGHESE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anu_sara_varghese/32/51487_2.png) [@ANU\_SARA\_VARGHESE](https://discuss.elastic.co/u/ANU_SARA_VARGHESE)
#### Post date: [September 27, 2016, 1:57pm UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612/1 "2016-09-27T13:57:06Z")

</div>

Hi,

How can I see the last or the latest indexed data on elasticsearch?

I tried out the url

[http://x.x.x.x:9200/myindex\_name](http://x.x.x.x:9200/myindex_name)

But I can only see the the field names which I had filtered in logstash and not any data.

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [September 27, 2016, 2:56pm UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612/2 "2016-09-27T14:56:29Z")

</div>

Do something like

```auto
curl -XGET `http://x.x.x.x:9200/myindex_name/_search -d '
{
  "sort": [{"_doc": "desc"}]
}
'

```

---

<div class="post-metadata">

### Author: ![ANU\_SARA\_VARGHESE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anu_sara_varghese/32/51487_2.png) [@ANU\_SARA\_VARGHESE](https://discuss.elastic.co/u/ANU_SARA_VARGHESE)
#### Post date: [September 28, 2016, 10:37am UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612/3 "2016-09-28T10:37:41Z")

</div>

Hi Adrien,

I had tried this out. But I am not getting the current indexed data.

In kibana, I could see the latest data indexed. But through the url I am only able to see data which dates some 2 weeks ago. Moreover, I could even see the exact total counts using the url

[http://x.x.x.x:9200/\_cat/count](http://x.x.x.x:9200/_cat/count)

Why is that I am not able to see the current indexed data?

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [September 28, 2016, 3:20pm UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612/4 "2016-09-28T15:20:33Z")

</div>

I think you are just not sorting based on the appropriate field? I did not know you had a timestamp field, so maybe what you are looking after is the following API call:

```auto
curl -XGET `http://x.x.x.x:9200/myindex_name/_search -d '
{
  "sort": [{"timestamp": "desc"}]
}
'

```

Just make sure to replace `timestamp` with the actual name of your timestamp field.

---

<div class="post-metadata">

### Author: ![ANU\_SARA\_VARGHESE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anu_sara_varghese/32/51487_2.png) [@ANU\_SARA\_VARGHESE](https://discuss.elastic.co/u/ANU_SARA_VARGHESE)
#### Post date: [September 29, 2016, 5:56am UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612/5 "2016-09-29T05:56:47Z")

</div>

Thanks Adrien. It worked

---

<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 5, 2017, 10:16pm UTC](https://discuss.elastic.co/t/view-last-indexed-data-on-elasticsearch/61612/6 "2017-07-05T22:16:18Z")

</div>


