Divide metrics and display them in Table Visualization

Hi,

I want to create a very basic visualization in kibana. I have a field in the document namely which signifies the amount of memory consumed. A watch writes data into this index every 10 minutes.

Each document in elasticsearch will have an array of instances of a cluster with memory details.
{"memory": {
"instance_capacity": 4096,
"memory_pressure": 6
} },
{"memory": {
"instance_capacity": 4096,
"memory_pressure": 6
} }

I want to see the metrics in table Visualization as follows

    |Cluster Name|Used Memory in MB|Capacity in MB|num_records|Average Capacity|Calculate max of sum (Capacity in MB/num_records)|
|---|---|---|---|---|---|
|threezones|108|73,728|6|4,096|12,288|
|36cabfb384b74cb29fd6db92f4e0d8e8|36|24,576|6|4,096|4,096|
|onezone|36|24,576|6|4,096|4,096|
|noli|84|55,296|6|4,608|9,216|
|3919ec0746fc443b970c0b73ba633ec0|90|202,752|6|16,896|33,792|

I used sum aggregation to collect 'Capacity in MB'. but since there are 6 records inserted in a period of 1 hour, i want to calculate the last column 'Calculate max of sum (Capacity in MB/num_records)' by dividing 'Capacity in MB' with 'num_records' for calculating the report. Can anyone have ideas how to acheive it or are there any better alternatives to calculate such metrics?

You could use a scripted field to do this calculation I think.

1 Like

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