# cfxdm - dm:tail

**dm:tail:** This cfxdm tag allows the user to fetch last 'n' rows from the queried data.

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

* **n (optional)**. Specify number of last rows that need to be listed. When this argument is not specified, by default it retrieves last 10 rows.

{% hint style="info" %}
For predictable results, use it along with **dm:sort** tag.
{% endhint %}

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:tail** tag to list last 'n' rows.

Enter the below command to select **VMware vROps Datastore Summary tag (\*vrops:datastore\_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:datastore_summary
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MVdeYcgylnhey0GcBbm%2F-MVdqUxBzyGEMfB4Lc_y%2FScreen%20Shot%202021-03-12%20at%208.30.29%20PM.png?alt=media\&token=265449c6-4b98-4e4a-90c0-a4d6c09a2132)

**Example 1:** List last 10 rows

Get the data from VMware vROps Datastore Summary tag (**\*vrops:datastore\_summary**) and list last 10 rows.

```
data --> dm:tail
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MVduHoEtSWPlgNCH6Kp%2F-MVdw2pRyM8kXeG9l1kX%2FScreen%20Shot%202021-03-12%20at%208.55.02%20PM.png?alt=media\&token=e71902e7-41cc-4d0b-b92c-4c65d03f47ef)

**Example 2:** Sort the data in ascending order and List last 20 rows.

Get the data from VMware vROps Datastore Summary tag (**\*vrops:datastore\_summary**), sort the data by datastore name and list last 20 rows.

```
data --> dm:sort columns = 'name' --> dm:tail n = 20
```

![](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MVduHoEtSWPlgNCH6Kp%2F-MVdwzosWAYkR89JULr1%2FScreen%20Shot%202021-03-12%20at%208.59.05%20PM.png?alt=media\&token=7b9845a8-8bba-42b6-881b-32ad9f74402d)
