Gill_32697
Nov 15, 2012Nimbostratus
help combining two irules
The two irules are from two different vips on the same BigIP.
I've tried to combine but i get erros, I can't get the brackets { in the right place with i write the irule.
I would like the irule to follow the logic as numbered below.
1= for the payment string use pool IIS_ECM.SWBC.com_pool
2= esle /holtcat use focusnet.swbc.co
3=- else check for uri path
"/akcelerant/"
"/idsakcelerant/"
"/idsakcelerantmtg/"
"/lmakcelerant/"
use pool Test-SWBC-Migration2
4= else everyting else use pool IIS_SWBC.com_pool
= irules are below ======================================================
primary irule name IIS_SWBC.comProcessorv3
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]]) equals "www.swbc.com" and
([string tolower [HTTP::uri]] contains "paymentprocessorv3")
([string tolower [HTTP::uri]] contains "paymentprocessorakc")
([string tolower [HTTP::uri]] equals "/paymentprocessorv3/creditcard.asmx")
([string tolower [HTTP::uri]] equals "/paymentprocessorv3/creditcard.asmx?wsdl")
([string tolower [HTTP::uri]] equals "/paymentprocessorv3/ach.asmx")
([string tolower [HTTP::uri]] equals "/paymentprocessorv3/ach.asmx?wsdl")
([string tolower [HTTP::uri]] equals "/paymentprocessorakc/ach.asmx")
([string tolower [HTTP::uri]] equals "/paymentprocessorakc/ach.asmx?wsdl")
([string tolower [HTTP::uri]] equals "/paymentprocessorakc/creditcard.asmx")
([string tolower [HTTP::uri]] equals "/paymentprocessorakc/creditcard.asmx?wsdl") } {
pool IIS_ECM.SWBC.com_pool
}
elseif { [string tolower [HTTP::host]] equals "www.swbc.com" and [string tolower [HTTP::uri]] equals "/holtcat" } {
HTTP::redirect https://focusnet.swbc.com/fnFProvider/fnFProvider.asp? app=HCEnrollmentTool&wanted=BECONFIRM&BenefitYear=2011&BenefitType=N
}
else {
pool IIS_SWBC.com_pool
}
}
=============================================================
second irule name Test-SWBC-URI
when HTTP_REQUEST {
use tolower to make the match case-insensitive
switch -glob [string tolower [HTTP::path]] {
"/akcelerant/"
"/idsakcelerant/"
"/idsakcelerantmtg/"
"/lmakcelerant/"
pool Test-SWBC-Migration2
}
}
}