# Get the major version of an index

**URL:** <https://discuss.elastic.co/t/get-the-major-version-of-an-index/357781>\
**Category:** Elastic Search\
**Created:** [April 19, 2024, 9:42am UTC](https://discuss.elastic.co/t/get-the-major-version-of-an-index/357781 "2024-04-19T09:42:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![staubt](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@staubt](https://discuss.elastic.co/u/staubt)\
**Post date:** [April 19, 2024, 9:42am UTC](https://discuss.elastic.co/t/get-the-major-version-of-an-index/357781/1 "2024-04-19T09:42:19Z")

</div>

Hello  
I need to get the major version of an index.  
So before I used indexName/\_settings?human=true. And in the result I parsed the "created\_string" from version. There I took the number before the fist dot.  
Now with 8.12. "created\_string" has the same content as "created". In 8.12. is it "8500010".

Is that intended? And if yes how can I parse the major version from that number. How is the "syntax" for that kind of version?

Thanks  
Thomas

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [April 24, 2024, 7:05pm UTC](https://discuss.elastic.co/t/get-the-major-version-of-an-index/357781/2 "2024-04-24T19:05:40Z")

</div>

Hey there @staubt this is definitely a bug, thanks for reaching out about it!

The good news, is that we already have an open [PR](https://github.com/elastic/elasticsearch/pull/107828) to resolve this, so this will be fixed in an upcoming version of Elasticsearch.

In the meantime, you can cross reference the data [here](https://github.com/elastic/elasticsearch/blob/main/server/src/main/resources/org/elasticsearch/index/IndexVersions.csv?plain=1) as a workaround.

---

<div class="post-metadata">

**Author:** ![staubt](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@staubt](https://discuss.elastic.co/u/staubt)\
**Post date:** [April 26, 2024, 7:39am UTC](https://discuss.elastic.co/t/get-the-major-version-of-an-index/357781/3 "2024-04-26T07:39:45Z")

</div>

Hi Kathleen  
Thanks for your answer. Until the PR is in I will simply read the first letter as fallback in case the string dosn't contain any dots.

---

<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:** [May 24, 2024, 7:40am UTC](https://discuss.elastic.co/t/get-the-major-version-of-an-index/357781/4 "2024-05-24T07:40:29Z")

</div>

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