Forum Discussion
collinz1_17223
Jun 06, 2011Nimbostratus
irule active_members <1 and MSIE 7
I have an irule that returns HTML when all pool members are down, this works fine, hower what i now want to do is return different HTML if users are using IE7. It would be great to be able to return differnt HTML for multiple other browsers (IE6 & IE7) also.
when HTTP_REQUEST {
if { ([active_members [LB::server pool]] < 1) and ( [string tolower [HTTP::header User-Agent]] eq [string tolower "*msie 7.*"])} {
HTTP::respond 200 content {
...
elseif { [active_members [LB::server pool]] < 1} {
HTTP::respond 200 content {
...
- nitassEmployeewhen HTTP_REQUEST {
- collinz1_17223NimbostratusThats great thanks. How would i specify multiple agents in the same line? I have tried the following as an example, but it doesnt appear to work:
- nitassEmployeei think matchclass/class with data group should be good. what bigip version r u running?
- collinz1_17223NimbostratusI'll check that out. Were running v10.2
- collinz1_17223Nimbostratusi have setup a data group (called msie) with string values of msie 6 & msie 7 and attempted to reference the group in an irule, but it doesn't appear to be working. Traffic seems to be matching my "else" statement.
- nitassEmployeecan u try this one?
- Colin_Walker_12Historic F5 AccountYou'll almost certainly want to use contains, not equals, otherwise you'll have to have the entire and exact entry in the class, and that would be a pain given all the different possible user agent strings. You'll also want to be sure that you're forcing everything to either upper or lowercase for the comparison.
- collinz1_17223NimbostratusThat did indeed work, thanks.
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