# Calculate new fields dynamically in elasticsearch

**URL:** <https://discuss.elastic.co/t/calculate-new-fields-dynamically-in-elasticsearch/162758>\
**Category:** Logstash\
**Created:** [January 3, 2019, 7:37am UTC](https://discuss.elastic.co/t/calculate-new-fields-dynamically-in-elasticsearch/162758 "2019-01-03T07:37:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [January 3, 2019, 7:37am UTC](https://discuss.elastic.co/t/calculate-new-fields-dynamically-in-elasticsearch/162758/1 "2019-01-03T07:37:49Z")

</div>

Hello,

I am loading data from database into elasticsearch using logstash ,

during loading, does Elastic Search allows us to create Trigger-like functionality with our own rules to create new fields?  
Ex:-  
can we add new fields dynamically to calculate the sum of 2 fields(x & y) and create a new field(z) to append the value(z = x + y) while loading.

---

<div class="post-metadata">

**Author:** ![admlko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/admlko/32/21787_2.png) [@admlko](https://discuss.elastic.co/u/admlko)\
**Post date:** [January 3, 2019, 12:30pm UTC](https://discuss.elastic.co/t/calculate-new-fields-dynamically-in-elasticsearch/162758/2 "2019-01-03T12:30:40Z")

</div>

Yes, I think what you are looking for is ingest functionality:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html)  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-processors.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-processors.html)

---

<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:** [January 31, 2019, 12:30pm UTC](https://discuss.elastic.co/t/calculate-new-fields-dynamically-in-elasticsearch/162758/3 "2019-01-31T12:30:41Z")

</div>

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