Show visualization of calculation between two field


(Mark) #1

Hi All

I am collecting vsphere stats via metricbeat and sending them to my elastic install.

What I would like to be able to show is the %age of cpu used and memory used.
Below is a log that shows the total cpu and used cpu and total memory and used memory, is it possible to do the calculation on these two fields to get the %age used and then show this as a visualization for a new dashboard i am building for office

Thanks in advance
Mar


(Jen Huang) #2

Yes, you can do this by creating a scripted field in Management > Index Patterns > Scripted fields > Add scripted field: https://www.elastic.co/guide/en/kibana/current/scripted-fields.html

Name the field whatever you'd like. The field should be number type and Percent format. The script itself should look something like this:

(doc['vsphere.host.cpu.used.mhz'].value + 0.0) / doc['vsphere.host.cpu.total.mhz'].value

Save the field and repeat the process for calculating memory. Then you can use the new scripted fields in visualizations.


(Mark) #3

Jen-huang Thank you very much for your reply.
I have now got exactly what I was after, such a brilliant product and community

Mark


(system) #4

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