getclassmetatags

Table of Contents

Prototype: getclassmetatags(classname, optional_tag)

Return type: slist

Description: Returns the list of meta tags for class classname.

Arguments:

  • classname: string, in the range: [a-zA-Z0-9_$(){}\[\].:]+

The optional_tag can be used to look up a specific tag's value. If you format your tags like meta => { "mykey=myvalue1", "mykey=myvalue2"} then the optional_tag of mykey will fetch you a list with two entries, { "myvalue1", "myvalue2" }.

Example:

body common control
{
      bundlesequence => { "example" };
}

bundle agent example
{
  classes:
      "c" expression => "any", meta => { "mytag", "other=once", "other=twice" };

  vars:
      "ctags" slist => getclassmetatags("c");
      "othertag_values" slist => getclassmetatags("c", "other");

  reports:
      "Found tags: $(ctags)";
      "Found tags for key 'other': $(othertag_values)";

}

Output:

R: Found tags: source=promise
R: Found tags: mytag
R: Found tags: other=once
R: Found tags: other=twice
R: Found tags for key 'other': once
R: Found tags for key 'other': twice

Notes:

See also: getvariablemetatags()

History: Function added in 3.6.0. optional_tag added in 3.10.0