Hi,

I'm using community version 3.0.3 and I'm getting the following error:

cf3:./test.cf:34,96: Unknown built-in function regextract(), near token ')'


Is there another way of extracting values into strings with 3.0.3? I'm hoping I 
don't have to upgrade all the servers to 3.0.4 yet.

This is what I was trying to do:

bundle agent test
{
        vars:
               "fqdn" string => execresult("/usr/bin/dig +short -x $(sys.ipv4) 
| grep $(sys.host) | sed -e 's/\.$//'","useshell");
        classes:
               "ok" expression => 
regextract("^([^\.]*)\.(.*)\.$","$(fqdn)","hostname_domain");
        reports:
                ok::
                       "HOST + DOMAIN: $(hostname_domain[0])";
                       "HOST: $(hostname_domain[1])";
                       "DOMAIN: $(hostname_domain[2])";
}

Thanks,
Eric
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to