Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


ame02
  •  ame02
  • Paid support Topic Starter
2019-01-29T15:05:03Z
Hello

Is it possible to catch multiple strings from standard output to generate an error?
The output can contain different values which indicates an error.

sample.jpg

Best regards
Adrian
Sponsor
Forum information
Gary_W
2019-01-30T15:51:23Z
You *should* be able to do something like this using regular expressions. For example this will work for Error output matching "Error1" or "Error2" as this regulr expression matches the word "Error" ending in a 1 or a 2.
UserPostedImage

The trouble arises when the words you want to match are completely different, as Visualcron regex is not fully implemented. For example, you SHOULD be able to do this:
{REGEX(MatchGetGroup,{TASK(Active,StdErr)},(SQLSTATE|login-error),1}
which means match the entire string "SQLSTATE" OR "login-error" but the pipe symbol which means "or" in regular expression syntax is special to VisualCron and this fails to work as expected.

Maybe Support will respond letting us know there is a different non-standard character to use for "or" or to let us know this will be fixed ASAP 🙂
ame02
  •  ame02
  • Paid support Topic Starter
2019-02-05T14:24:51Z
Unfortunately this doesn't work. Iv'e tried some different possibilities. But no luck.
Gary_W
2019-02-05T14:37:29Z
yes, this is one for Visualcron Support to answer as it has to do with regular expression support and specifically the pipe character which should mean a logical OR inside of the regular expression group.
Support
2019-02-05T16:45:15Z
If you want to use pipes in a Variables you can replace the parameter delimiter by placing the parameter delimiter you want to use first. For example if I want to use @ sign:

{REGEX(@Match@1111,222,33@\A[0-9]*)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Gary_W
2019-02-05T17:38:28Z
I stand corrected! The key is to put the substitution character for the pipe IN FRONT OF THE "MATCH". In my post #2 I didn't do that. So, if you change your value/variable in my example screencap above to:

{REGEX(,Match,{TASK(Active,StdErr)},(SQLSTATE|login-error))}

it should work, matching either string "SQLSTATE" or login-error".

Thanks Henrik, that's an important regex trick to know here.
Scroll to Top