DiskUsage is an integer value, not a string, so its use as the second argument of regexps() like this is an error.
EVALMACRO tmp.MyReq = regexps("25",DiskUsage,"33") Also, unfortunately the return value of regexps() here is just the output â33â when there is a match. You can see this by using condor_status to test. condor_status -limit 1 -af âregexps(â25â, â250000â, â33â) 33 condor_status -limit 1 -af âregexps(â25(.*)â, â250000â, â33\1â) 330000 I had forgotten that reqxps works that way, so my original suggestion needed a different regexps _expression_. To do a substitution in place, you need to use capture groups to preserve text before and after. So this works EVALMACRO tmp.MyReq = regexps("(.*)25(.*)",unparse(DiskUsage),"\\133\\2") SET Requirements $(tmp.MyReq) Producing this output from condor_transform_ads -verbose EVALMACRO tmp.MyReq to regexps("(.*)25(.*)",unparse(DiskUsage),"\\133\\2") tmp.MyReq = 3300000 SET Requirements to 3300000 DiskUsage = 2500000 Requirements = 3300000 ResidentSetSize = 500 By the way, I think it is a bug that you have to double up the \ for EVALMACRO, when testing the reqexps() _expression_ in condor_status. I only used a single \, but condor_transform_ads required \\ which means that is parsing those expressions
using ânew classadsâ syntax, which is wrong. -tj From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx>
On Behalf Of Collin Mehring Hi Thomas, You can include the rest of the original value using capture groups. For example: regexps("^25(\d+)",unparse(DiskUsage),"33\1") Also, it looks like you're overriding the entire Requirements _expression_ in that last example instead of DiskUsage. Hope this helps, Collin On Mon, Oct 15, 2018 at 8:17 AM Thomas Hartmann <thomas.hartmann@xxxxxxx> wrote:
-- Collin Mehring | PE-JoSE - Software Engineer |