search cancel

EEM subtraction filters regex options for multiple domains

book

Article ID: 256486

calendar_today

Updated On:

Products

CA Workload Automation AE

Issue/Introduction

Hello,
We are using for years regex with subtraction for in EEM policies filters.

Example: 
WHERE
(
request: req:resource
(E)
calculation: "[A-Z0-9]{3}\."STRING(gug:Name - "_AutosysDeveloper")"\_[0-9]{0,10}\_{0,1}[a-zA-Z0-9-._]{1,42}$"
OR
request: req:resource
(E)
calculation: "[A-Z0-9]{3}\."STRING(gug:Name - "_AutosysDeveloper")"\_[a-zA-Z0-9-._]{1,53}$"
AND
request: req:resource
--*
value: val:H1R.

Now we are building a new environment with multiple domains and hence a group contains domain and backslash in front of the group name: example:

gscorp-cn\123_AutosysDeveloper.

Calculation in the filter should be like that:

"[A-Z0-9]{3}\."STRING(gug:Name - "gscorp-cn\" - "_AutosysDeveloper")"...

However, it does not work.

Could you please let me know if this is supported and if so, what is incorrect in this subtraction?

Thank you.

Environment

Autosys R11.x 12.x
EEM 12.x

Cause

EEM is based on the CA directory
For CA directory/EEM when using Regex and doing a subtraction or minus in the regex it can only remove trailing characters.

Resolution

I was able to track down the root cause of why this is failing with the new configuration.
It does not have anything to do with multiple domain setup.
1) EEM is based on the CA directory
2) For CA directory/EEM when using Regex and doing a subtraction or minus in the regex it can only remove trailing characters.
Working example:
calculation: "[A-Z0-9]{3}\."STRING(gug:Name - "_AutosysDeveloper")"\_[0-9]{0,10}\_{0,1}[a-zA-Z0-9-._]{1,42}$"

Actual string testing:
206431_AutosysDeveloper

Result string:
206431

Non-Working Example:
"[A-Z0-9]{3}\."STRING(gug:Name - "gscorp-cn\" - "_AutosysDeveloper")"

Actual string testing:
gscorp-cn\206431_AutosysDeveloper

Desired Result string:
206431

However, this requires removing data at the beginning and the end which is not supported.

https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=20032

Please note that the "MINUS" operator for the string can only be used to subtract the trailing strings.
For example, if the group name is "abcdefd", the operation: <group name> - "d" on the group makes it to be "abcdef".

REGEX, XPATH are not supported in calculations.

The operations supported under STRING for a calculation filter are:

PLUS: Concatenate two strings
MINUS: Subtract the trailing string.
STRIP: remove leading or trailing white spaces

 

You might try other Regex combinations.
An example might be:
(?<=\\)(.*?)(?=\_)

Actual string testing:
gscorp-cn\206431_AutosysDeveloper

Result string:
206431

Unfortunately, if you can not find another regex that meets your needs I will not have any other possible solution for you without a code change through an enhancement request that would need to be submitted via our Idea wall.