# How to Generate UUID from Index Name?

**URL:** <https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979>\
**Category:** Elasticsearch\
**Created:** [January 26, 2023, 12:32am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979 "2023-01-26T00:32:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nebula](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Nebula](https://discuss.elastic.co/u/Nebula)\
**Post date:** [January 26, 2023, 12:32am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979/1 "2023-01-26T00:32:02Z")

</div>

Hello everyone,

I have some index patterns setup in my Elasticsearch. I see the index name gets encoded as a UUID in the URL (the value for the key “index:” in the URL once an index is selected).

How can I go about generating this UUID from the index name? I would prefer not to use any of the APIs and use strictly local code to generate the UUID from the index name. Does anyone know the method to generating these UUIDs?

From my understanding these mappings are stored in the .kibana file. I am looking for a method to generate the UUID based on the text and not looking in this file.

Thanks.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [January 26, 2023, 1:34am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979/2 "2023-01-26T01:34:27Z")

</div>

Hi Nebula

you will have to use kibana API to get index template ( data view) and that will give you uuid

try this on your kibana's dev tool for one of your index name

`GET index_template_name/_settings`

---

<div class="post-metadata">

**Author:** ![Nebula](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Nebula](https://discuss.elastic.co/u/Nebula)\
**Post date:** [January 26, 2023, 1:42am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979/3 "2023-01-26T01:42:41Z")

</div>

Hi Elasticforme,

Thank you for your reply. I am looking specifically for a way without using any of the APIs. Do you know how this UUID is generated?

Ideally, I would like to generate this value from the index name myself.

Thanks.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 26, 2023, 2:27am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979/4 "2023-01-26T02:27:08Z")

</div>

A [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) is unlike a hash not derived from any particular string, but rather based on other parameters like time and location, which makes it unique. It can not be derived from the index pattern. You will therefore need to use the APIs.

---

<div class="post-metadata">

**Author:** ![Nebula](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Nebula](https://discuss.elastic.co/u/Nebula)\
**Post date:** [January 26, 2023, 3:36am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979/5 "2023-01-26T03:36:16Z")

</div>

Thank you, for your answer. Much appreciated!

---

<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:** [February 23, 2023, 3:36am UTC](https://discuss.elastic.co/t/how-to-generate-uuid-from-index-name/323979/6 "2023-02-23T03:36:30Z")

</div>

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