abeny_894
Dec 03, 2008Nimbostratus
How to combine two iRules into one?
Dears,
First of all, I would like to say thanks to all of you that I have learned much on iRules in here.
I have a question on how can I combine separate iRules into ONE? The situation is I have got several separate iRules on hand as below: They are all using HTTP_REQUEST, the different is iRules One is using [HTTP::host], iRules Two is using [HTTP::uri], iRules Three is using [HTTP::host][HTTP::uri]. If test separatly, they all work fine for apply to One VS.
As the real case may involve ALL of the below case in one VS, I would like to ask can they be combine into one? How can I do this?? Thank you very much for you guys help.
___________________________________________________________________________________
****iRules One****
when HTTP_REQUEST {
switch [HTTP::host] {
abc.com {
log local0. "hit abc.com"
Details scriptes
xyz.com {
log local0. "hit xyz.com"
Details scripts
****iRules Two****
when HTTP_REQUEST {
switch [HTTP::uri] {
/app1/index.html {
log local0. "hit abc/app1/index.html"
Details scriptes
/app2/index.html {
log local0. "hit xyz/app1/index.html"
Details scriptes
****iRules Three****
when HTTP_REQUEST {
switch [HTTP::host][HTTP::uri] {
abc.com/app1/index.html {
log local0. "hit abc.com"
Details scriptes
xyz.com/app2/index.html {
log local0. "hit xyz.com"
Details scripts
___________________________________________________________________________________