Neil_66348
Nov 09, 2010Nimbostratus
iRule GeoIP Targeting
Hi Guys ,
We're looking to implement some targeting thats found in 10.2 on our F5's.
Performing matching at the IP level works fine , I've found some example code for matching to the internal quova database. The example below as pulled from an article on the F5 website , however can't seem to get it to compile.
We've created an iRule data Group list of type String as well.
when HTTP_REQUEST {
set region [class match -value [whereis [IP::client_addr] abbrev] equals uk_regions]
if { $region ne "" } {
switch $region York { pool $region }
Greater London { HTTP::redirect http://dev.application.com/grlondon }
Leeds { HTTP::redirect http://dev.application.com/leeds}
Stockport { HTTP::redirection http://dev.application.com/stockport }
} else { pool devpool }
}
When going to complile I get the errors o:
line 4: [wrong args] [switch $region]
line 5: [undefined procedure: York] [York { pool $region }]
line 6: [undefined procedure: Greater] [Greater London { HTTP::redirect http://dev.application.com/grlondon }]
line 7: [undefined procedure: Leeds] [Leeds { HTTP::redirect http://dev.application.com/leeds}]
line 8: [undefined procedure: Stockport] [Stockport { HTTP::redirection http://dev.application.com/stockport }]
Any help greatly appreciated.
many Thanks
Nei