cfxdm - dm:sort

Sort the data in ascending or descending order

dm:sort: This cfxdm tag allows the user to sort the data for a given column(s) in ascending or descending order.

dm:sort syntax: It supports the below arguments

  • columns (mandatory). It accepts one or more column names. If more than one column is specified, use comma as a separator.

  • order (optional). Supported values are 'ascending' or 'descending'. When not specified, default applied sort order is 'ascending'

dm:sort columns = 'COLUMN_A,COLUMN_B,..'

OR

dm:sort columns = 'COLUMN_A,COLUMN_B,..' & order = 'ascending/descending'

In the below example, for a reference, we are going to use VMware vROps as an extension to query the data and ingest it into dm:sort tag for applying the sort capability.

Enter the below command to select VMware vROps VM Summary tag (*vrops:vm_summary). (In this example, vrops name is used as a label to identify VMware vROps extension and it's tags. The label is defined while adding the extension in cfxdx configuration file or through UI.)

tag *vrops:vm_summary

Example 1: Sort the selected column. (ascending order)

Get the data from VMware vROps VM Summary tag (*vrops:vm_summary) which includes some of the below columns, sort the data by 'datastore' column.

Column Names:

  • guest_hostname

  • guest_ip_address

  • guest_full_name

  • datastore

  • ...

Below command queries the data from vROps vm_summary tag and sorts the data by column name 'datastore' in ascending order. (when 'order' (optional) param is not specified, it sorts in ascending order by default).

data --> dm:sort columns = 'datastore'

Example 2: Sort the selected column. (descending order)

Get the data from VMware vROps VM Summary tag (*vrops:vm_summary) which includes some of the below columns, sort the data by 'datastore' column.

Column Names:

  • guest_hostname

  • guest_ip_address

  • guest_full_name

  • datastore

  • ...

Below command queries the data from vROps vm_summary tag and sorts the data by column name 'datastore' in descending order.

data --> dm:sort columns = 'datastore' & order = 'descending'

Example 3: Sort the selected multiple columns. (descending order)

Get the data from VMware vROps VM Summary tag (*vrops:vm_summary) which includes some of the below columns, sort the data by 'guest_full_name' and 'datastore' columns.

Column Names:

  • guest_hostname

  • guest_ip_address

  • guest_full_name

  • datastore

  • ...

Below command queries the data from vROps vm_summary tag and sorts the data by both column names 'guest_full_name' and 'datastore' in descending order.

data --> dm:sort columns = 'datastore,guest_full_name' & order = 'descending'

Last updated