How to filter operation data

I want to implement a command to display operational data.

show test result
AAA Passed
BBB Failed
CCC Passed

Is there a way to add a filter in yang to allow the user to display Passed or Failed data?
Example:

show test result filter Passed
AAA Passed
CCC Passed

show test result filter Failed
BBB Failed

I don’t want to use the built in CLI “match” because it may not work with Netconf.

Any help is greatly appreciated. Thanks.

Say you have some YANG like this:

  container test {
    config false;
    list result {
      tailf:cli-suppress-mode;
      key "test";
      leaf test { 
        type string; 
      }
      leaf result {
        tailf:cli-drop-node-name;
        type enumeration {
         enum Passed;
         enum Failed;
        } 
      }
    }
  } 

You can then use wildcards if /confdConfig/cli/allowWildcard is set to “true”, which is default in your confd.conf.
Example:

# show test result * Passed
TEST  RESULT  
--------------
AAA   Passed  
CCC   Passed  

# show test result * Failed
TEST  RESULT  
--------------
BBB   Failed