I can try to give a quick overview but there are folks here that know way more than I
😄
So to get started with iRules you should definitely check out the iRules homepage:
http://devcentral.f5.com/wiki/default.aspx/iRules.HomePage
To give you a quick rundown of this rule in particular, here is the flow:
While the transaction is in the HTTP_REQUEST state, as opposed to HTTP_RESPONSE or some other state. this rule will be run.
The 'if' statement will grab the HTTP::host and make it all lowercase for the comparison, so there is no difference between My.com, MY.com or my.com.
The switch will look at the User-Agent portion of the HTTP::header, you can use several options:
http://devcentral.f5.com/wiki/default.aspx/iRules/switch.html
Glob basically allows the use of some wildcards, so "*BlackBerry*" will match anything that contains "BlackBerry". So the following will look for UserAgents that match, and then use mobile_pool at the end.
switch -glob [HTTP::header User-Agent] {
"*BlackBerry*" -
"*Blackberry*" -
"*Java/1.4.1_02*" -
"*Blazer*" -
"*blazer*" -
"*palm*" -
"*Palm*" -
"*SMARTPHONE*" -
"*Smartphone*" -
"*smartphone*" -
"*Danger*" -
"*hiptop*" -
"*MOT-*" -
"*RAZR*" -
"*AUDIOVOX*" -
"*Symbian*" -
"*symbian*" -
"*NOKIA*" -
"*Nokia*" -
"*Sony Ericsson*" -
"*Samsung*" -
"*LG 8*" -
"*Alcatel 735i*" -
"*Nextel*" -
"*Windows CE*" -
"*NetFront*" {
pool mobile_pool
}
}
If nothing above matches, we look for the Accept portion of the header, if it contains "*text/vnd.wap.wml*" then it will go to the mobile_pool
switch -glob [HTTP::header Accept] {
"*text/vnd.wap.wml*" {
pool mobile_pool
}
}
If none of the above matches, it either follows the remaining rules or whatever is set in the profile, which could be a default pool.