# Adding a field base on others field

**URL:** <https://discuss.elastic.co/t/adding-a-field-base-on-others-field/135376>\
**Category:** Logstash\
**Created:** [June 11, 2018, 2:05pm UTC](https://discuss.elastic.co/t/adding-a-field-base-on-others-field/135376 "2018-06-11T14:05:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradana](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@Pradana](https://discuss.elastic.co/u/Pradana)\
**Post date:** [June 11, 2018, 2:05pm UTC](https://discuss.elastic.co/t/adding-a-field-base-on-others-field/135376/1 "2018-06-11T14:05:50Z")

</div>

Hi,

I have field of a "operator" which consist a content of 5 digits string like :

62811  
62812  
62814  
62817

I would like to add another field with name "operatorname" with the content is the mapping of above data.

e,g : 62811 --\> is map to A, 62812 is map to A, 62814 is map to B, 62817 is map to C.

How I can achieved above objective in grok ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 11, 2018, 2:35pm UTC](https://discuss.elastic.co/t/adding-a-field-base-on-others-field/135376/2 "2018-06-11T14:35:03Z")

</div>

Use a [translate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html) filter.

---

<div class="post-metadata">

**Author:** ![Pradana](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@Pradana](https://discuss.elastic.co/u/Pradana)\
**Post date:** [June 11, 2018, 3:56pm UTC](https://discuss.elastic.co/t/adding-a-field-base-on-others-field/135376/3 "2018-06-11T15:56:36Z")

</div>

Thanks. It is working.

---

<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:** [July 9, 2018, 3:56pm UTC](https://discuss.elastic.co/t/adding-a-field-base-on-others-field/135376/4 "2018-07-09T15:56:37Z")

</div>

Closed on July 9, 2018, 3:56pm UTC

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