Display sum of two valiues as percentage in Kibana 5.3

Hi
I apologize for my beginner question.
I've created an index in elasticstack with contains all my servers and includes fields for server function, installed and used memory, example below:
name, function, installed memory, used memory
server1, Database, 512, 128
server2, web. 512, 64
server3, web, 512, 512

In Kibana 5.3, how do I display in tabular form the sum of installed memory, sum of used memory and % used memory by server function?

I've created Data Table Visualization which displays the sum of installed and used memory by server function but I can't see how to add the sum of used memory as a percentange of the sum of the installed memory.

Thanks in advance

1 Like

You can create a data table with the following metrics:

Aggregation: Sum
Field: "installed memory"

Aggregation: Sum
Field: "used memory"

Then split the rows on a Terms aggregation on the function.

In order to get the percentage, you will need to add a scripted field. You can do this in Management under your index pattern. Select the scripted field. You script would look something like this doc['mem.used'].value / doc['mem.installed'].value

Thanks for the info on the data table

Re. the percentage - I'm not sure your suggestion will work for me as I think the scripted field will calculate the result for each row (which I can then aggregate in the data table) whereas I want to calculate the percentage of the aggregated values. Is this possible?

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