cfxdm - dm:bin
Grouping the data in different bins
dm:bin: This cfxdm tag allows the user to group the numerical data into different bins,
What is data binning ? : Binning is a way to group numbers that are continuous values into a smaller number groups which are called as "bins". For example, if you have data about a group of people, you might want to arrange their ages into a smaller number of age groups. (5-15 years, 20-35 years, 45-65 years etc..)
dm:bin syntax:
    column (mandatory): Column name which has numerical values
    bins (mandatory): comma separated numerical range values
In the below example, for a reference, we are going to use VMware vCenter as an extension to query the data from VMs tag and their disk size.
Enter the below command to select VMware vCenter VMs tag (*vcenter:vms). (In this example, vcenter name is used as a label to identify VMware vCenter extension and it's tags. The label is defined while adding the extension in cfxdx configuration file or through UI)
1
tag *vcenter:vms
Copied!
Example-1:
Get VM's list and limit the ouput to VM's Name, Disk Size in KB and VM's BIOS UUID and save it as named dataset. (vm-disk-size)
1
data * get name as 'vm_name',disk_capacity_KB as 'disk_capacity_kb',id as 'bios_uuid' --> dm:save name = 'vm-disk-size'
Copied!
Recall the named dataset (vm-disk-size) and convert the disk size to MB. (use dm:recall tag for the below query)
1
data name = 'vm-disk-size' --> dm:map attr = 'disk_capacity_kb' & func = 'evaluate' & expr = "disk_capacity_kb / 1024"
Copied!
Create the 'bins' for VM's disk size which fall between 40000,75000,100000,150000,200000 MB in size. (use dm:recall tag for the below query)
1
data name = 'vm-disk-size' --> dm:map attr = 'disk_capacity_kb' & func = 'evaluate' & expr = "disk_capacity_kb / 1024" --> dm:bin column = 'disk_capacity_kb' & bins = '40000,75000,100000,150000,200000'
Copied!
Last modified 7mo ago
Copy link