For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Nader_125543's avatar
Nader_125543
Icon for Nimbostratus rankNimbostratus
Sep 05, 2013

APM/TCL question, how to replace the fouth octet in network address which include subnet

I have a variable which I inquiry from AD, the variable is in form of x.x.x.x/255.255.255.0 - I need to replace the fourth octet with "0", normally it is set to .254 I have tried this but it does not work

- regsub -all {<.254/>} expr { [mcget {session.ad.last.attr.wWWHomePage}]} .0/ 

Any help or suggestion is appreciated

2 Replies

  • Try this:

    set tmp [regsub -all {.254/} [mcget {session.ad.last.attr.wWWHomePage}] .0/]; return $tmp
    
  • I haven't messed with expressions too much in APM, so I'm not sure if string map is supported in them, but if it is, string map should work:

    % set x 10.10.10.254/255.255.255.0
    10.10.10.254/255.255.255.0
    % string map ".254 .0" $x
    10.10.10.0/255.255.255.0
    

    keep in mind this will match any occurrence of .254, so if there is a chance it will show in the 2nd or 3rd octet you'll need to interrogate a little deeper.