# Map Elasticsearch field to predefined list

**URL:** <https://discuss.elastic.co/t/map-elasticsearch-field-to-predefined-list/172732>\
**Category:** Elasticsearch\
**Created:** [March 18, 2019, 9:29am UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-predefined-list/172732 "2019-03-18T09:29:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luke14](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@luke14](https://discuss.elastic.co/u/luke14)\
**Post date:** [March 18, 2019, 9:29am UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-predefined-list/172732/1 "2019-03-18T09:29:04Z")

</div>

Hi

So I have question about how best to approach a problem I need to solve. In one of my indexes within ES I have the field:

> user.id: U123456

This is great, however I have a list of username associated with user id's. So

> U123456 = John

In kibana is there a way of just mapping this in the presentation layer? Do I have to add an if statement into my logstash and then add a new field in ES with the user.name field?

Whats the best way of doing this, which is manageable?

The data does not contain the username as is currently.

Thanks

---

<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:** [March 18, 2019, 9:38am UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-predefined-list/172732/2 "2019-03-18T09:38:47Z")

</div>

The best option is to do it during ingestion, so Logstash.

---

<div class="post-metadata">

**Author:** ![luke14](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@luke14](https://discuss.elastic.co/u/luke14)\
**Post date:** [March 18, 2019, 9:40am UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-predefined-list/172732/3 "2019-03-18T09:40:26Z")

</div>

Thanks for the reply,

Okay I will add some new logic to create a new field in logstash.

Thanks

---

<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:** [April 15, 2019, 9:40am UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-predefined-list/172732/4 "2019-04-15T09:40:30Z")

</div>

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