APM variable assign examples
Problem this snippet solves: APM variable assign is a powerful tool to manipulate APM variable during policy evaluation supporting tcl code.
On Devcentral answers, there are lots of variable assig...
Updated Jun 06, 2023
Version 2.0Stanislas_Piro2
Cumulonimbus
Joined January 04, 2011
Steph
Apr 03, 2019Nimbostratus
@Stansislas,
Sorry for the late reply, I did solve it like that (not the most effective way but it works):
{session.custom.internaldevice = set current_ip [mcget {session.user.clientip}] ; if { $current_ip starts_with "10.10.10.10" } then { return 2 ; Specific is 2 } elseif {$current_ip starts_with "10.10." } then { return 1 ; INTERNAL is 1 } else { return 0 ; EXTERNAL is 0 };
I need to put the result in a variable, since I need it in a pre-request policy as well.
Thanks for your feedback