# Where is the unique identifier for the tenant index name created in source code

**URL:** <https://forum.search-guard.com/t/where-is-the-unique-identifier-for-the-tenant-index-name-created-in-source-code/985>\
**Category:** Search Guard\
**Created:** [June 29, 2018, 8:44pm UTC](https://forum.search-guard.com/t/where-is-the-unique-identifier-for-the-tenant-index-name-created-in-source-code/985 "2018-06-29T20:44:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@robert](https://forum.search-guard.com/u/robert)\
**Post date:** [June 29, 2018, 8:44pm UTC](https://forum.search-guard.com/t/where-is-the-unique-identifier-for-the-tenant-index-name-created-in-source-code/985/1 "2018-06-29T20:44:58Z")

</div>

- Search Guard and Elasticsearch version 6.2.4

Hi,

Where is the unique identifier for the tenant index name created in source code? The unique identifier I’m referring to is the nine-digit number in the index name between “.kibana\_-” and the tenant name. For example, where is “152937574” created for tenant index name “.kibana\_-152937574\_tenantname?”

Currently, Searchguard does not create the tenant index until an index-pattern is created/indexed through Kibana GUI. I want to automate indexing documents to the tenant index before this happens, so I need to know the tenant index name, e.g. .kibana\_-152937574\_tenantname."

So, how can I find out this unique identifier, through source code or by other means

Thanks

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [July 1, 2018, 10:48am UTC](https://forum.search-guard.com/t/where-is-the-unique-identifier-for-the-tenant-index-name-created-in-source-code/985/2 "2018-07-01T10:48:09Z")

</div>

It is calculated in PrivilegesInterceptorImpl#toUserIndexName like:

originalKibanaIndex+“_“+tenant.hashCode()+”_”+tenant.toLowerCase().replaceAll(“[^a-z0-9]+”

``

> **···**
>
> On Friday, June 29, 2018 at 10:43:09 PM UTC+2, [robert@elementdata.com](mailto:robert@elementdata.com) wrote:
> 
> > 
> 
> > - Search Guard and Elasticsearch version 6.2.4
> 
> > 
> 
> > Hi,
> 
> > 
> 
> > Where is the unique identifier for the tenant index name created in source code? The unique identifier I’m referring to is the nine-digit number in the index name between “.kibana\_-” and the tenant name. For example, where is “152937574” created for tenant index name “.kibana\_-152937574\_tenantname?”
> 
> > 
> 
> > Currently, Searchguard does not create the tenant index until an index-pattern is created/indexed through Kibana GUI. I want to automate indexing documents to the tenant index before this happens, so I need to know the tenant index name, e.g. .kibana\_-152937574\_tenantname."
> 
> > 
> 
> > So, how can I find out this unique identifier, through source code or by other means
> 
> > 
> 
> > Thanks
