# How to define field's name later?

**URL:** <https://discuss.elastic.co/t/how-to-define-fields-name-later/144209>\
**Category:** Elasticsearch\
**Created:** [August 13, 2018, 4:12pm UTC](https://discuss.elastic.co/t/how-to-define-fields-name-later/144209 "2018-08-13T16:12:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastienf](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@sebastienf](https://discuss.elastic.co/u/sebastienf)\
**Post date:** [August 13, 2018, 4:12pm UTC](https://discuss.elastic.co/t/how-to-define-fields-name-later/144209/1 "2018-08-13T16:12:10Z")

</div>

I receive strings like this : "type|v1|v2|v3|v4|..."  
I split this one according the "|" and I insert in an index "index\_{type}" a document with fields named "v1" : {v1}, "v2" : {v2}, etc.  
Later (days, weeks...), labels v1, v2, v3, v4 are known, for example as, "cpu\_pct","mem\_pct","dsk\_occ", etc. and I want that "v1" becomes "cpu\_pct", "v2" becomes "mem\_pct", etc.  
What I want is to replace former / generic label "v1", "v2", ... by the new one...  
I know it is possible but it implies a reindexation ; so do you have any suggestion to make it in the best away possible ?

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [August 14, 2018, 1:26am UTC](https://discuss.elastic.co/t/how-to-define-fields-name-later/144209/2 "2018-08-14T01:26:37Z")

</div>

Fields are defined at index time. There is no such thing as renaming a field. The only way is to reindex.

---

<div class="post-metadata">

**Author:** ![sebastienf](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@sebastienf](https://discuss.elastic.co/u/sebastienf)\
**Post date:** [August 14, 2018, 7:29am UTC](https://discuss.elastic.co/t/how-to-define-fields-name-later/144209/3 "2018-08-14T07:29:55Z")

</div>

Thank you. That is what i was thinking, but I hoped there was a trick to make it 🙂  
For example, the index-alias function is very interesting and I was wondering if there is a way to alias a field as well (that doesn't exist as a built-in function but maybe it is possible to achieve this throught another way...).

---

<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:** [August 14, 2018, 8:05am UTC](https://discuss.elastic.co/t/how-to-define-fields-name-later/144209/4 "2018-08-14T08:05:35Z")

</div>

There are field aliases coming in later versions/

---

<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:** [September 11, 2018, 8:05am UTC](https://discuss.elastic.co/t/how-to-define-fields-name-later/144209/5 "2018-09-11T08:05:43Z")

</div>

Closed on September 11, 2018, 8:05am UTC

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