Why are you so sure it is the regex.extract and not something that follows? It looks okay.
Well I am actually not 100% sure, but since there is nothing afer that statement excepting the end statements, that looks like the best candidate, but it looks bloody OK to me as well. Here is the complete body of the pattern. Note that for debugging purposes there is a lot that can be removed afterwards.
on process := DiscoveredProcess where cmd matches unix_cmd "java"
and args matches regex "\boud_ed\b";
// Host and cluster information.
host := model.host(process);
hosting_node := related.hostingNode(fallback_kind := "Cluster");
log.debug("Hostname: " + hosting_node.name);
// Initialize variables.
si_key := '';
si_type := '';
si_short_type := '';
si_name := '';
si_short_name := '';
si_instance := '';
si_version := '';
si_fullversion := '';
package_regex := '';
// Oracle Unified Directory Server specification.
si_type := 'Oracle Unified Directory Server';
si_short_type := 'OUD';
si_short_name := si_short_type;
log.debug("short SI type = %si_short_type%, SI type = %si_type%");
// ODSP AV: the version should be based on command:
// $ /var/app/oud/oud_ed/OUD/bin/status --version
// Oracle Unified Directory 18.104.22.168.181016
// Build 20180830103720Z
oud_cmd := '/var/app/oud/oud_ed/OUD/bin/status';
if discovery.fileInfo(host, oud_cmd) then
log.debug("OUD command exists = %oud_cmd%");
output := discovery.runCommand(host, "%oud_cmd% --version | grep 'Oracle Unified Directory'");
if output and output.result then
log.debug("output.result = (%output.result%)");
if output.result matches regex 'Oracle Unified Directory (\S+)' then
log.debug ("OK regex match");
log.debug ("NOK regex not match");
raw_version := regex.extract(output.result, regex 'Oracle Unified Directory (\S+)', raw "\1");
log.debug ("could not extract output from command - check command output with regex.");
log.debug("not enough privileges or command not found on %host.name%");
Do you have more details on the error?
Is this pattern calls Server?
I stopped and started the tideway stack - no changes, still the same error. I also tried to print a debug output immediately after the regex.extract statement, this would not print. That lead me to conclude that the regex.extract was somehow not OK.
Now I rewrote the regex.extract statement - no copy paste at all - uploaded it - and now it works.
Any invisible character? No idea. Really not! Do you have some similar experiences?
1 of 1 people found this helpful
I remember having issues with quotes if cut and pasted from windows...
I definitely cut and pasted from windows, so this may well be it...