Here is a workaround I have used in the past.
Add this iRule to the Virtual Server...
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "my_dns_lookup" } {
if { [ACCESS::session data get session.my_loop_counter] eq "1" } {
set hostname [ACCESS::session data get session.logon.last.MyHostDestination]
ACCESS::session data set session.HostIP_1 [RESOLV::lookup @10.10.10.10 -a $hostname]
set found [ACCESS::session data get session.HostIP_1]
log local0. "Host: $hostname ...and what we found:$found ."
} elseif { [ACCESS::session data get session.my_loop_counter] eq "2" } {
set hostname [ACCESS::session data get session.logon.last.MyHostDestination]
ACCESS::session data set session.HostIP_2 [RESOLV::lookup @10.10.10.10 -a $hostname]
set found [ACCESS::session data get session.HostIP_2]
log local0. "Host: $hostname ...and what we found:$found ."
} elseif { [ACCESS::session data get session.my_loop_counter] eq "3" } {
set hostname [ACCESS::session data get session.logon.last.MyHostDestination]
ACCESS::session data set session.HostIP_3 [RESOLV::lookup @10.10.10.10 -a $hostname]
set found [ACCESS::session data get session.HostIP_3]
log local0. "Host: $hostname ...and what we found:$found ."
}
}
}
In the VPE...
-
Create a new Variable Assign Object at the beginning of the policy (before the macro)
Name: my_loop_counter initial
Assignment: session.my_loop_counter = Text 0
-
Create a new Variable Assign Object after the form where they enter the hostname.
Name: my_loop_counter_assign
Assignment: session.my_loop_counter = expr { [mcget {session.my_loop_counter}] + 1 }
-
Create a new Variable Assign Object after the iRule Event Object (you will need to use the ID "my_dns_lookup" for the iRule Event Agent).
Name: Variable Assign
Assignment:
session.HostIP = if { [mcget {session.my_loop_counter}] eq "1" }
{ expr { [mcget {session.HostIP_1}] }
} elseif { [mcget {session.my_loop_counter}] eq "2" }
{ expr { [mcget {session.HostIP_2}] }
} elseif { [mcget {session.my_loop_counter}] eq "3" }
{ expr { [mcget {session.HostIP_3}] }
}
You will then need to do your session.HostIP check later in the VPE.
I hope this helps you get this configured.
-Seth