# cfxdm - dm:selectcolumns

**dm:selectcolumns:** This cfxdm tag allows the user to include or exclude columns using a regular expression format after retrieving the data from an extension's tag.

It is very useful when the user is dealing with many columns from an extension's tag and it simplifies columns select using either include or exclude or both options together

**dm:selectcolumns** synta&#x78;**:**&#x20;

* **include (**&#x6F;ptiona&#x6C;**):** Specify a column or columns in regular expression format to include matched columns.
* **exclude (**&#x6F;ptiona&#x6C;**):** Specify a column or columns in regular expression format to exclude matched columns.

In the below example, for reference, we are going to use **VMware vROps** as an extension to query the data and ingest it into **dm:selectcolumns** to select specific columns using include/exclude or both together.

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

```
tag @vrops:alerts
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MVi1J-o3X92eod9Zbws%2F-MVi2SEZYVnklETBKvgq%2FScreen%20Shot%202021-03-13%20at%204.05.37%20PM.png?alt=media\&token=5e00c0a0-f9d3-4172-bcc2-191702893ac6)

**Example 1:** Select matched columns using the include option

Get the data from VMware vROps Alerts tag (**@vrops:alerts**) and select any column that starts with **alert** and **start (below are all available columns from vrops:alerts tab)**

* **alertDefinitionId**&#x20;
* **alertDefinitionName**&#x20;
* **alertId**&#x20;
* **alertImpact**&#x20;
* **alertLevel**&#x20;
* cancelTimeUTC&#x20;
* controlState&#x20;
* links&#x20;
* resourceId&#x20;
* **startTimeUTC**&#x20;
* status&#x20;
* subType&#x20;
* suspendUntilTimeUTC&#x20;
* type&#x20;
* updateTimeUTC

```
data --> @dm:selectcolumns include = 'alert.*|start.*' 
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MVi2Z4rpwFWxKFZg18E%2F-MVi4wpaM_8aSqle7yTI%2FScreen%20Shot%202021-03-13%20at%204.16.25%20PM.png?alt=media\&token=05d57f10-aeb7-4f21-976d-6ed46211e6b5)

**Example 2:** Select matched columns using the include and exclude option

Get the data from VMware vROps Alerts tag (**@vrops:alerts**) and select any column that starts with **alertDefinitionName** or contains **Time,** but excludes **alertImpact** and **suspendUntilTimeUTC** columns using regular expression.

```
data --> @dm:selectcolumns include = 'alert.*.Name|.*Time.*' & exclude = 'suspend.*|.*Impact'
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MVi2Z4rpwFWxKFZg18E%2F-MVi8KRmLhlA1Cdea3jA%2FScreen%20Shot%202021-03-13%20at%204.31.21%20PM.png?alt=media\&token=8f3ef908-93ee-426c-aa5a-a2ffd884fdcc)
