# How to know operdata executed for which leaf node in the list?

**URL:** <https://dmap-community.ductus.global/t/how-to-know-operdata-executed-for-which-leaf-node-in-the-list/1092>\
**Category:** YANG\
**Created:** [March 21, 2017, 6:33pm UTC](https://dmap-community.ductus.global/t/how-to-know-operdata-executed-for-which-leaf-node-in-the-list/1092 "2017-03-21T18:33:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkannadassan](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bkannadassan](https://dmap-community.ductus.global/u/bkannadassan)\
**Post date:** [March 21, 2017, 6:33pm UTC](https://dmap-community.ductus.global/t/how-to-know-operdata-executed-for-which-leaf-node-in-the-list/1092/1 "2017-03-21T18:33:27Z")

</div>

Hi Experts!

We have a following yang file format

```
container root {
  list systemmonitor {
    config false;
    tailf:cli-incomplete-show-path;

    key name;
    tailf:callpoint respcp;

    leaf name {
      type string
    }

    leaf cpu-usage {
      type string..
    }
    leaf memory-usage {
      type string..
    }
    leaf harddisk-usage {
      type string..
    }
  }
}

```

I would want to return value based on the leaf node selected. So its basically their are many entries in the list… like

name =\> CPUMonitorHigh this has only cpu-usage field set with HIGH String  
name =\> CPUMonitorLow this has only cpu-usage filed set with LOW String

one way I do is “show … | include HIGH” but is their anyway to know in the code that show is executed with this leaf-node ? i.e “cpu-usage / mem-usage…” so on…

rgds  
Balaji

---

<div class="post-metadata">

**Author:** ![mnovak](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mnovak/32/183_2.png) [@mnovak](https://dmap-community.ductus.global/u/mnovak)\
**Post date:** [March 28, 2017, 7:34am UTC](https://dmap-community.ductus.global/t/how-to-know-operdata-executed-for-which-leaf-node-in-the-list/1092/2 "2017-03-28T07:34:35Z")

</div>

Hello,

to understand more, please can you describe your show command (perhaps write full show command for your example)?

In case you mean something like this:

`show root systemmonitor CPUMonitorHigh cpu-usage` , then you would receive data provider `get_elem` callback directly for `leaf cpu-usage`

If you mean something like `show root systemmonitor | include CPUMonitorHigh`, then you will get all list elements (lines) which contains `CPUMonitorHigh`. The filtering is done on CLI level, so in the C callback you will get request for all data (won’t be able to figure out the filter after `include`). You can test it with simple data provider implementation (see examples `intro\5-c_stats`)

As this is more detailed CLI question (CLI filtering), it is better to use support and open RT ticket for it.
