# Modify Index name in Response

**URL:** <https://discuss.elastic.co/t/modify-index-name-in-response/277346>\
**Category:** Elasticsearch\
**Created:** [June 29, 2021, 12:07pm UTC](https://discuss.elastic.co/t/modify-index-name-in-response/277346 "2021-06-29T12:07:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daksh0225](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daksh0225/32/90336_2.png) [@daksh0225](https://discuss.elastic.co/u/daksh0225)\
**Post date:** [June 29, 2021, 12:07pm UTC](https://discuss.elastic.co/t/modify-index-name-in-response/277346/1 "2021-06-29T12:07:09Z")

</div>

Hello!!  
I have made some changes to the codebase to modify the index name for certain types of requests. However, I don't want the user to know about any such changes that I have made. So, I want to modify the index name before the response is sent back to the user.  
For example, suppose i have made the following modification to the index name **bank** provided by the user - **\<prefix\_string\>\_bank**. In this case, a response will contain

```auto
_index: <prefix_string>_bank

```

but I want it to still show

```auto
_index: bank

```

How can this be done?

---

<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:** [July 3, 2021, 5:58pm UTC](https://discuss.elastic.co/t/modify-index-name-in-response/277346/2 "2021-07-03T17:58:57Z")

</div>

I do not think tehre is anything in Elasticsearch that allows you to do that so you probably need to do that translation in your application.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 5, 2021, 2:13am UTC](https://discuss.elastic.co/t/modify-index-name-in-response/277346/3 "2021-07-05T02:13:55Z")

</div>

Christian is correct, you need to handle this in your own code.

---

<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:** [August 2, 2021, 2:14am UTC](https://discuss.elastic.co/t/modify-index-name-in-response/277346/4 "2021-08-02T02:14:09Z")

</div>

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