Because you are doing an if statement within an if statement I'd say you would need this:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::remote_addr] equals 192.168.1.1]}
{ if {[TCP::client_port equals 80} {pool Our-HTTP_Pool}}
if { [IP::addr [IP::remote_addr] equals 192.168.1.1]}
{ if {[TCP::client_port equals 22} {pool IRule-22-Test}}
}
A more elegant way would be:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::remote_addr] equals 192.168.1.1]}
{ if {[TCP::client_port equals 80} {pool Our-HTTP_Pool}}
elseif {[TCP::client_port equals 22} {pool IRule-22-Test}
}
You might want to consider what you want to do with traffic that doesn't match.