# Add new field base on existing filed

**URL:** <https://discuss.elastic.co/t/add-new-field-base-on-existing-filed/84894>\
**Category:** Logstash\
**Created:** [May 8, 2017, 8:01am UTC](https://discuss.elastic.co/t/add-new-field-base-on-existing-filed/84894 "2017-05-08T08:01:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Qian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_qian/32/2148_2.png) [@Ryan\_Qian](https://discuss.elastic.co/u/Ryan_Qian)\
**Post date:** [May 8, 2017, 8:01am UTC](https://discuss.elastic.co/t/add-new-field-base-on-existing-filed/84894/1 "2017-05-08T08:01:15Z")

</div>

I need extract a field from log file, then take this field to query DB (or redis or whatever a service I write), then add this result as a new field.

which filter should I use? or I have to write my own plugin?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 8, 2017, 8:29am UTC](https://discuss.elastic.co/t/add-new-field-base-on-existing-filed/84894/2 "2017-05-08T08:29:50Z")

</div>

The new jdbc\_streaming filter is probably the best option.

---

<div class="post-metadata">

**Author:** ![Ryan\_Qian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_qian/32/2148_2.png) [@Ryan\_Qian](https://discuss.elastic.co/u/Ryan_Qian)\
**Post date:** [May 9, 2017, 1:04am UTC](https://discuss.elastic.co/t/add-new-field-base-on-existing-filed/84894/3 "2017-05-09T01:04:42Z")

</div>

Thank you Magnus， after some dig around, I decide to use translate filter, the dictionary file which translate need, I will write a service watch db change, then generate period.

---

<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:** [June 6, 2017, 1:04am UTC](https://discuss.elastic.co/t/add-new-field-base-on-existing-filed/84894/4 "2017-06-06T01:04:55Z")

</div>

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