# JSON input on result

**URL:** <https://discuss.elastic.co/t/json-input-on-result/159229>\
**Category:** Kibana\
**Created:** [December 3, 2018, 5:59pm UTC](https://discuss.elastic.co/t/json-input-on-result/159229 "2018-12-03T17:59:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wheelq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wheelq/32/35893_2.png) [@wheelq](https://discuss.elastic.co/u/wheelq)\
**Post date:** [December 3, 2018, 5:59pm UTC](https://discuss.elastic.co/t/json-input-on-result/159229/1 "2018-12-03T17:59:14Z")

</div>

Is it possible to do arithmetic operations on results? I'd like to subtract 1000 from sum. But it seems like JSON input treats \_value as input value before doing the sum

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [December 4, 2018, 4:53pm UTC](https://discuss.elastic.co/t/json-input-on-result/159229/2 "2018-12-04T16:53:10Z")

</div>

Can you provide more context? What are you trying to accomplish? What Kibana plugin are you trying to apply sum to the response?

Thanks,  
Nathan

---

<div class="post-metadata">

**Author:** ![wheelq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wheelq/32/35893_2.png) [@wheelq](https://discuss.elastic.co/u/wheelq)\
**Post date:** [December 4, 2018, 7:40pm UTC](https://discuss.elastic.co/t/json-input-on-result/159229/3 "2018-12-04T19:40:46Z")

</div>

I tried different Kibana visualisations. I started with Bar graph and SUM.  
Normally sum of 5 elements (each element has a value set to 2), results in 10.  
But when I add to JSON input: {"script":"\_value+1"} it adds +1 to every 2, and all 5 values of '2' become '3', and the result is 15.

What I need is to add 1 to the results, so I am expecting 11. How can I achieve this?

---

<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 1, 2019, 7:43pm UTC](https://discuss.elastic.co/t/json-input-on-result/159229/4 "2019-01-01T19:43:55Z")

</div>

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