Forum Discussion
Jeff_Tuthill_10
Aug 12, 2009Nimbostratus
Thanks for the leads hoolio!!!
I am trying this rule but get an error on line 14 "Command not valid in current context"...Can I collect the DNS name and then make a pool assignment based on that within the same iRule?
when HTTP_RESPONSE {
Hold HTTP data until IP address is resolved
HTTP::collect
Start a name resolution on the Client IP address
NAME::lookup [IP::client_addr]
}
when NAME_RESOLVED {
log local0. "client name = >[NAME::response]>"
Release HTTP data once hostname is resolved
HTTP::release
}
when HTTP_REQUEST {
set client [NAME::response]
if {$client contains "domain.com"} {
pool pool1
} else {
discard
}
}