# Percentage calculation in kibana using json Inputs

**URL:** <https://discuss.elastic.co/t/percentage-calculation-in-kibana-using-json-inputs/286442>\
**Category:** Kibana\
**Created:** [October 12, 2021, 7:11am UTC](https://discuss.elastic.co/t/percentage-calculation-in-kibana-using-json-inputs/286442 "2021-10-12T07:11:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nijanthan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nijanthan/32/94663_2.png) [@Nijanthan](https://discuss.elastic.co/u/Nijanthan)\
**Post date:** [October 12, 2021, 7:11am UTC](https://discuss.elastic.co/t/percentage-calculation-in-kibana-using-json-inputs/286442/1 "2021-10-12T07:11:59Z")

</div>

How to calculate the failure percentage in kibana using the json inputs ?  
The kql query for success is statusCode:200 nd for failure is NOT STATUSCODE:200.  
I need to calculate the (failure/total)×100.

I'm using kibana 7.10.2 version nd  
I need to calculate the percentage without using the scripted fields in the index management

---

<div class="post-metadata">

**Author:** ![sebastien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien/32/36119_2.png) [@sebastien](https://discuss.elastic.co/u/sebastien)\
**Post date:** [October 12, 2021, 10:04am UTC](https://discuss.elastic.co/t/percentage-calculation-in-kibana-using-json-inputs/286442/2 "2021-10-12T10:04:24Z")

</div>

Hi @Nijanthan

If you can't use scripted field or better **runtime field** for that then you will have to create the new "failureRate" percentage field at ingest time. For that you will probably need an [ingest pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html).

Cheers,  
Sébastien

---

<div class="post-metadata">

**Author:** ![Nijanthan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nijanthan/32/94663_2.png) [@Nijanthan](https://discuss.elastic.co/u/Nijanthan)\
**Post date:** [October 12, 2021, 10:48am UTC](https://discuss.elastic.co/t/percentage-calculation-in-kibana-using-json-inputs/286442/3 "2021-10-12T10:48:27Z")

</div>

Is there any other way to calculate percentage in data table ?

---

<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:** [November 9, 2021, 10:48am UTC](https://discuss.elastic.co/t/percentage-calculation-in-kibana-using-json-inputs/286442/4 "2021-11-09T10:48:42Z")

</div>

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