JSON Input for Kibana charts

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 but I didn't get any help from that.

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

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.

No, it only supports that which elasticsearch supports.

1 Like

Okay. Thanks!

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.

2 Likes

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!

5 Likes

+1 please answer

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.

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.