# How to sum fields value (mem used = user used + system used)

**URL:** <https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613>\
**Category:** Kibana\
**Created:** [March 7, 2016, 3:03am UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613 "2016-03-07T03:03:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![szcountryboy](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@szcountryboy](https://discuss.elastic.co/u/szcountryboy)\
**Post date:** [March 7, 2016, 3:03am UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613/1 "2016-03-07T03:03:28Z")

</div>

How to on line chart display memory usage. The acquisition of the back of the data memory is divided into user and system use, I think the combined display, but inside the metrics and did not provide several fields of polymerization method. There are other ways to solve it?

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 7, 2016, 3:04am UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613/2 "2016-03-07T03:04:33Z")

</div>

You can create a scripted field to do this for you - [https://www.elastic.co/guide/en/kibana/current/managing-fields.html#create-scripted-field](https://www.elastic.co/guide/en/kibana/current/managing-fields.html#create-scripted-field)

---

<div class="post-metadata">

**Author:** ![szcountryboy](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@szcountryboy](https://discuss.elastic.co/u/szcountryboy)\
**Post date:** [March 7, 2016, 3:26am UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613/3 "2016-03-07T03:26:56Z")

</div>

Thanks very much

---

<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 7, 2016, 3:27am UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613/4 "2016-03-07T03:27:52Z")

</div>

When you get it working how you want please do share the result, it may help someone else too! 😃

---

<div class="post-metadata">

**Author:** ![szcountryboy](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@szcountryboy](https://discuss.elastic.co/u/szcountryboy)\
**Post date:** [March 7, 2016, 3:57am UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613/5 "2016-03-07T03:57:08Z")

</div>

I am very sorry, I forgot to post on how to solve the problem  
Can refer to the following steps

1\> Scripted fields tab sheet, click button 'Add Script Field'  
2\>name :input the unique name  
Format: choice bytes  
Script : doc['cpu.used'].value + doc['cpu.system'].value  
3\>click 'Create Field'

And then reference the field at the interface.

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:** [July 6, 2017, 2:00pm UTC](https://discuss.elastic.co/t/how-to-sum-fields-value-mem-used-user-used-system-used/43613/6 "2017-07-06T14:00:02Z")

</div>


