Forum Discussion
Sahir_180434
Nimbostratus
Jan 21, 2016Need help with iRule error log message
Hi all, I am working on upgrading an ltm from 10.2.4 to 11.5.3, all iRules on current 10.2.4 code are working fine but when did the upgrade I got the following error on one of the iRules: Jan...
Sahir_180434
Nimbostratus
Jan 27, 2016Kai,
first, Thanks for your effort trying to help on this & you could be right about the rule not being stable. second, as I mentioned before I am an iRules newbie, and have no idea what is this iRule is doing, I was given this project and I am still learning, I am a Cisco guy in first place.
third, I am wondering if you missed an else statement in your suggested code in the following part:
when HTTP_REQUEST {
if { [active_members et-pool] == 0 } {
HTTP::redirect "http://[HTTP::header "X-Forwarded-Host"]/unavailable/etServices.html"
} else {
if { [HTTP::header exists "X-Forwarded-Host"] } {
HTTP::header replace "Host" [HTTP::header "X-Forwarded-Host"]
}
if { [HTTP::cookie exists "em-et"] } {
log local0. "Persisting by cookie em-et, contents are [HTTP::cookie "em-et"]"
} else {
set pool_member [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"]]
if { $pool_member ne "" } {
pool ets_80-pool member $pool_member
log local0. "jsessionID [findstr [HTTP::uri] "jsessionid" 11 "!"] sent to [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"] ]"
} else {
pool ets_80-pool
log local0. "No jsession ID, local balancing the connection..."
}
}
}
}and is it should be?
when HTTP_REQUEST {
if { [active_members et-pool] == 0 } {
HTTP::redirect "http://[HTTP::header "X-Forwarded-Host"]/unavailable/etServices.html"
} else {
if { [HTTP::header exists "X-Forwarded-Host"] } {
HTTP::header replace "Host" [HTTP::header "X-Forwarded-Host"]
} else{
if { [HTTP::cookie exists "em-et"] } {
log local0. "Persisting by cookie em-et, contents are [HTTP::cookie "em-et"]"
} else {
set pool_member [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"]]
if { $pool_member ne "" } {
pool ets_80-pool member $pool_member
log local0. "jsessionID [findstr [HTTP::uri] "jsessionid" 11 "!"] sent to [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"] ]"
} else {
pool ets_80-pool
log local0. "No jsession ID, local balancing the connection..."
}
}
}
}Thanks.
- Kai_WilkeJan 27, 2016
MVP
Hi Sahir, your provided code didn't contain the "else{" on this position. And placing it on this position would make the code structure incomplete. So i highly doubt this needs to be insert... Note: Basically I've just adjusted your iRule formatings to get a better overview. And then changed just the part which throws the error by adding an additional check. Well, it was hard to resist to not optimize additional parts... ;-) BTW: Greetings from a Cisco fellow. I'm sitting right now in front of an C2960XR and applying some boring edge configs... ;-) Cheers, Kai - Sahir_180434Jan 27, 2016
Nimbostratus
I am going to try your modified code and see if that is going to solve the issue, will let you know about the result. Thanks.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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