# Manipulate fields in Kibana

**URL:** <https://discuss.elastic.co/t/manipulate-fields-in-kibana/308512>\
**Category:** Kibana\
**Created:** [June 29, 2022, 7:14pm UTC](https://discuss.elastic.co/t/manipulate-fields-in-kibana/308512 "2022-06-29T19:14:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [June 29, 2022, 7:14pm UTC](https://discuss.elastic.co/t/manipulate-fields-in-kibana/308512/1 "2022-06-29T19:14:27Z")

</div>

Hello. We are using ELK 7.6.2 stack.

Kibana console shows the fields as follows:

![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/6746095caec1750d7075f89b7f597d8d3711f508.png)

I want to introduce/ add a new field displayed as say "sum" and it should display the sum of "before" and "after" (highlighted as yellow in the picture).

Can this be done using the Kibana console?

Please guide.

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [July 6, 2022, 3:54am UTC](https://discuss.elastic.co/t/manipulate-fields-in-kibana/308512/2 "2022-07-06T03:54:05Z")

</div>

Hello @zaeemmasood

Have you looked at using scripted fields? [Scripted fields | Kibana Guide [7.6] | Elastic](https://www.elastic.co/guide/en/kibana/7.6/scripted-fields.html)

Kibana 7.11 and newer introduces runtime fields and deprecates scripted fields. The apis are a little different but the scripting languages are very similar.

---

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [July 6, 2022, 8:48pm UTC](https://discuss.elastic.co/t/manipulate-fields-in-kibana/308512/3 "2022-07-06T20:48:23Z")

</div>

Thanks. It worked!

Just added the following script:

```auto
doc['before'].value - doc['after'].value

```

---

<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:** [August 3, 2022, 8:48pm UTC](https://discuss.elastic.co/t/manipulate-fields-in-kibana/308512/4 "2022-08-03T20:48:53Z")

</div>

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