# JSON Input for Kibana charts

**URL:** <https://discuss.elastic.co/t/json-input-for-kibana-charts/290>\
**Category:** Kibana\
**Created:** [May 6, 2015, 1:00pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290 "2015-05-06T13:00:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nimit\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Nimit\_Shah](https://discuss.elastic.co/u/Nimit_Shah)\
**Post date:** [May 6, 2015, 1:00pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/1 "2015-05-06T13:00:58Z")

</div>

Hi, Can anyone explain me how to use JSON Input for Kibana charts?  
I went through [http://www.quora.com/How-do-I-use-JSON-Input-field-under-Advanced-in-X-Axis-Aggregation-in-Kibana-4](http://www.quora.com/How-do-I-use-JSON-Input-field-under-Advanced-in-X-Axis-Aggregation-in-Kibana-4) but I didn't get any help from that.

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashid/32/12566_2.png) [@rashid](https://discuss.elastic.co/u/rashid)\
**Post date:** [May 7, 2015, 4:43pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/2 "2015-05-07T16:43:30Z")

</div>

Basically its for adding parameters to the current aggregation that Kibana wouldn't usually support. Eg, `shard_size` in the Terms agg

---

<div class="post-metadata">

**Author:** ![Nimit\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Nimit\_Shah](https://discuss.elastic.co/u/Nimit_Shah)\
**Post date:** [May 10, 2015, 2:45pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/3 "2015-05-10T14:45:17Z")

</div>

So it won't let me do mathematical calculations, right?  
I wanted to plot a chart where Y axis would be a ratio of two different parameters so I was wondering if I could calculate the ratio via JSON input.  
As in something like "New field":"(Passed/Failed)"; or something.

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashid/32/12566_2.png) [@rashid](https://discuss.elastic.co/u/rashid)\
**Post date:** [May 11, 2015, 3:46pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/4 "2015-05-11T15:46:16Z")

</div>

No, it only supports that which elasticsearch supports.

---

<div class="post-metadata">

**Author:** ![Nimit\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Nimit\_Shah](https://discuss.elastic.co/u/Nimit_Shah)\
**Post date:** [May 14, 2015, 10:36am UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/5 "2015-05-14T10:36:30Z")

</div>

Okay. Thanks!

---

<div class="post-metadata">

**Author:** ![colinsmcintyre](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@colinsmcintyre](https://discuss.elastic.co/u/colinsmcintyre)\
**Post date:** [June 17, 2015, 8:07am UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/6 "2015-06-17T08:07:20Z")

</div>

Just looking into something similar and while you can't do this via the JSON input, you can do this sort of thing via scripted fields.

Go to Kibana -\> Settings -\> Indices. On your index there will be two tabs, Fields and Scripted Fields. Choose Scripted Fields and click the add button on the right, it'll show you the type of operations you can use. An example of a script I used is:

doc['duration'].value/doc['quantity'].value

Once created you should be able to use the field on the Y-axis.

---

<div class="post-metadata">

**Author:** ![John\_Sotiropoulos](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@John\_Sotiropoulos](https://discuss.elastic.co/u/John_Sotiropoulos)\
**Post date:** [January 17, 2016, 1:52pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/7 "2016-01-17T13:52:48Z")

</div>

Hello!

I have another user case that I can't find out yet.

I have 2 fields srcIP and dstIP and I want to be able to show a line chart with X-axis the time and Y-axis the \<_counter of dstIP_\>/\<_counter of srcIP_\> (where dstIP = srcIP) at each time for the top 5 ratios or for a specific IP.

Is this possible through scripted fields? The thing is that there is a limited choice in Y-axis. Do you know if I can count a specific value of a field i.e. count( if srcIP == 10.1.2.3) ? Finally, if I can add more choices to Y-axis options like divide 2 metrics/counters?

Thank you in advance. Any insights about this would be very helpful!

---

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [January 28, 2016, 11:00am UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/8 "2016-01-28T11:00:32Z")

</div>

+1 please answer

---

<div class="post-metadata">

**Author:** ![blindpet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blindpet/32/7678_2.png) [@blindpet](https://discuss.elastic.co/u/blindpet)\
**Post date:** [February 9, 2016, 2:15pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/9 "2016-02-09T14:15:13Z")

</div>

Is it right that these JSON input parameters cannot do any real searches in elasticsearch then?

We are trying to secure a user's Kibana instance so they can only present data from the indexes we decide. We already used rewrite rules to block the Settings section but we want to make sure the JSON Input parameters cannot be used maliciously.

---

<div class="post-metadata">

**Author:** ![Meenakshi07](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Meenakshi07](https://discuss.elastic.co/u/Meenakshi07)\
**Post date:** [August 25, 2016, 6:55am UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/10 "2016-08-25T06:55:06Z")

</div>

Hi,

Can we also have just doc['col1'].value? Actually, I want this value to be plotted on Y-axis, but Kibana allows to use along with aggegration only(say, unique count(something). Please someone help on 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:** [July 6, 2017, 1:40pm UTC](https://discuss.elastic.co/t/json-input-for-kibana-charts/290/11 "2017-07-06T13:40:22Z")

</div>


