findlocalusers
Prototype: findlocalusers(filter)
Return type: data
Description: Returns a data container of all local users with their attributes that are matching a filter. If no filter is specified, it will return all the local users.
Arguments:
filter:string- Filter list - in the range:.*
The filter
 argument can be used to look up users with specific attributes that match values. The filter is a "data" container or "slist" comprised of pairs of attribute and value/regex pattern { "attribute1=value1", "attribute2=value2", ... }.
The possible attributes are:
name: nameuid: user idgid: group idgecos: descriptiondir: path to home directoryshell: default shell
Example:
body common control
{
  bundlesequence => { "example" };
}
bundle agent example
{
  vars:
    "root_filter"
      slist => {"gid=0", "name=root"};
    "root_container"
      data => findlocalusers("@(root_filter)");
    "root_list"
      slist => getindices("root_container");
    "bin_filter"
      data => '["name=bin"]';
    "bin_container"
      data => findlocalusers("@(bin_filter)");
    "bin_list"
      slist => getindices("bin_container");
  reports:
    "List: $(root_list)";
    "List: $(bin_list)";
}Output:
R: List: root
R: List: bin
Notes:
- This function is currently only available on Unix-like systems.
 
History:
- Function added in 3.26.0.