Get count of fields in Kibana

Hello,

we're gathering an inventory of virtual machines from vcenters. I was just wondering if there's a way we can create a new field with a count of total VMs or with a count of the total number of ESX servers or something like the total memory of all VMs.
However I'm not sure how to get this done. I did try creating scripted fields, but if I understood it right it can used only a doc.

For example, I was able to create a new field converting memory in mb to memory in gb. However how can I create a new field containing the sum of memory of all VMs?

I'm no expert, but I can sense that it doesn't make sense trying to add a field with the same value to all docs. But can we create a new index which contains such calculated values?

You could create a kibana metric, with a unique count of your hostnames. No need to create a field in elasticsearch.

metric

1 Like

Thanks a lot! That was a life-saver.

1 Like

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