# Get last update time for an index

**URL:** https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365
**Category:** Elasticsearch
**Created:** [March 3, 2017, 8:57pm UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365 "2017-03-03T20:57:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)
#### Post date: [March 3, 2017, 8:57pm UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365/1 "2017-03-03T20:57:54Z")

</div>

Is there a way to get last updated time for index? I looked up on forum and google and there used to be \_timestamp field, but was deprecated. Wondering if it was replaced with something else.

Thank you.

---

<div class="post-metadata">

### Author: ![hariso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hariso/32/50668_2.png) [@hariso](https://discuss.elastic.co/u/hariso)
#### Post date: [March 3, 2017, 10:11pm UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365/2 "2017-03-03T22:11:26Z")

</div>

The \_timestamp field was provided for documents, not an index, right? i.e. what is a last updated time for an index. The last time a document was indexed? Or the last time index settings/mappings/etc. were changed?

---

<div class="post-metadata">

### Author: ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)
#### Post date: [March 3, 2017, 11:50pm UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365/3 "2017-03-03T23:50:53Z")

</div>

That's actually correct. I thought it was at index level.

But the question still remains the same, is there a way to know when was the index updated? I hope there is a way to find that out, doesn't seem that difficult of a problem to solve from what I understand about ES. Just that I don't know how to get that information.

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [March 4, 2017, 3:31am UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365/4 "2017-03-04T03:31:51Z")

</div>

> [@animageofmine](#):
>
> But the question still remains the same, is there a way to know when was the index updated?

Today this is not possible.

> [@animageofmine](#):
>
> I hope there is a way to find that out, doesn't seem that difficult of a problem to solve from what I understand about ES.

It's more difficult than it sounds. Since this is index metadata, the master would have to be responsible for tracking it. That means a master operation on every indexing request, which is entirely too expensive. If we relax the guarantees, we can remove the need for a master operation, but then there are consistency issues to deal with.

---

<div class="post-metadata">

### Author: ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)
#### Post date: [March 4, 2017, 5:41am UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365/5 "2017-03-04T05:41:40Z")

</div>

Jason, thank you for the details. You could consider creating a separate metadata index.

Adding to every index document and running sort query seems too expensive. I am thinking of creating another metadata index for the same like mentioned above.

Do you have a suggestion or have a better / optimal solution?

---

<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: [April 1, 2017, 5:41am UTC](https://discuss.elastic.co/t/get-last-update-time-for-an-index/77365/6 "2017-04-01T05:41:46Z")

</div>

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