Forum Discussion
irule not working as expected
thankyou for your response , but with above irule it is throwing exception, with the if statement to check the pool member availability.
- jaikumar_f5Jan 30, 2019MVP
Pls share us the error msg. A snapshot if possible. I'll try out this if possible & update you.
- sandiksk_35282Feb 13, 2019Altostratus
when HTTP_REQUEST { if { [HTTP::header "SOAPAction"] equals "; } { pool prod_ro } elseif { [HTTP::header "SOAPAction"] equals "; } { pool prod_ro } elseif { [HTTP::header "SOAPAction"] equals "; } { if { [active_members prod_ro] > 0 } pool prod_ro } else { pool prod_pool }
}
01070151:3: Rule :irule:7: error: [missing a script after "if"][]
with if else if , i cannot run another if condition.
- jaikumar_f5Feb 13, 2019MVP
That's not what I shared in the Irule code above. Where you able to test that.
- jaikumar_f5Feb 13, 2019MVP
Nevertheless, the Irule you share here, has syntax problem, here's the correct version with indentation, so that you can close the loops properly.
when HTTP_REQUEST { if { [HTTP::header "SOAPAction"] equals "http://www.tech.com/Details" } { pool prod_ro } elseif { [HTTP::header "SOAPAction"] equals "http://www.tech.com/ValueBalances" } { pool prod_ro } elseif { [HTTP::header "SOAPAction"] equals "http://www.tech.com/ValuePoints" } { if { [active_members prod_ro] > 0 } { pool prod_ro } else { pool prod_pool } } }
Or combining both the if & elseif with a OR operator.
when HTTP_REQUEST { if { ([HTTP::header "SOAPAction"] equals "http://www.tech.com/Details") || ([HTTP::header "SOAPAction"] equals "http://www.tech.com/ValueBalances") } { pool prod_ro } elseif { [HTTP::header "SOAPAction"] equals "http://www.tech.com/ValuePoints" } { if { [active_members prod_ro] > 0 } { pool prod_ro } else { pool prod_pool } } }
Recent Discussions
Related Content
* 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