Forum Discussion
mbamusa_59409
Sep 02, 2013Nimbostratus
irule to distribute based on user agent
Hello ;
could you please help me creating irule to send traffic to specific pool if its comes from IE6,7 and 8 and rest to default pool .
Your kind assistance is highly appreciated.
mb...
nitass
Employee
will this work ? when HTTP_REQUEST { if {[string tolower [HTTP::header User-Agent]] contains "msie6" or "msie7" or "msie8"}{ pool Pool1 }else { pool Pool2 } }
you have to repeat [string tolower [HTTP::header User-Agent]] (or set it to variable first and re-use it later) in if-condition.
e.g.
set uagent [string tolower [HTTP::header User-Agent]]
if { $uagent contains "msie6" or $uagent contains "msie7" or $uagent contains "msie8"} {
or you may use switch instead of if-condition.
e.g.
[root@ve11a:Active:Not All Devices Synced] config tmsh list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
switch -glob [HTTP::header value "User-Agent"] {
"*MSIE 6*" -
"*MSIE 7*" -
"*MSIE 8*" {
pool qux
}
default {
pool [LB::server pool]
}
}
}
}
mbamusa_59409
Sep 03, 2013Nimbostratus
Thank you Nitass ,
is the below OK ?
set uagent [string tolower [HTTP::header User-Agent]]
if { $uagent contains "msie6" or $uagent contains "msie7" or $uagent contains "msie8"}{ pool Pool1
} else {
pool Pool2
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects