# How to get the value of count in JSON Input!

**URL:** <https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986>\
**Category:** Kibana\
**Created:** [October 11, 2018, 6:24am UTC](https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986 "2018-10-11T06:24:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxWang](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@MaxWang](https://discuss.elastic.co/u/MaxWang)\
**Post date:** [October 11, 2018, 6:24am UTC](https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986/1 "2018-10-11T06:24:09Z")

</div>

I want to modify the value of count in JSON Input like that  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/6/26588adf1acf0b34ae0eb2e8ca1cdb1778c7eb90.png)  
but it dosn't work,however,it work for other Metric Aggregation,sum, min and so on.

---

<div class="post-metadata">

**Author:** ![MaxWang](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@MaxWang](https://discuss.elastic.co/u/MaxWang)\
**Post date:** [October 11, 2018, 7:06am UTC](https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986/2 "2018-10-11T07:06:43Z")

</div>

😭

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [October 11, 2018, 10:32am UTC](https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986/3 "2018-10-11T10:32:15Z")

</div>

You cannot add an inline script in the JSON input, but you could achieve a similar result by using a Scripted field in Kibana, where you set it's value as "100" and then do a Sum metric on that field instead of the Count.

---

<div class="post-metadata">

**Author:** ![MaxWang](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@MaxWang](https://discuss.elastic.co/u/MaxWang)\
**Post date:** [October 12, 2018, 1:47am UTC](https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986/4 "2018-10-12T01:47:34Z")

</div>

Thank you for your answer very much，I'll try it.

---

<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, 2018, 1:47am UTC](https://discuss.elastic.co/t/how-to-get-the-value-of-count-in-json-input/151986/5 "2018-11-09T01:47:34Z")

</div>

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