Forum Discussion
Mike_Perez_6161
Nimbostratus
Feb 18, 2010Parse the first and second character in the path?
I know what I have got below is not parsing the second character but is sort of displaying the concept.
Can some please give me a hand in the simplest form?
when ...
Mike_Perez_6161
Nimbostratus
Feb 18, 2010Aaron,
Thanks a bunch for the idea here. It really got my wheels spinning. Got it to work with lowercase only at first. So basically repeated it with uppercase a the first letter to parse. Also the issue with it character ranging within the string was a huge road block. Was addressed by creating another query by going to the next character and still pointing it to the correct pool. A little more work but gets the job done. Aaron thanks again.
example will explain what I am talking about above.
when HTTP_REQUEST {
Parse the first then second character in the path
switch -glob [HTTP::path] {
"/a[a-lA-L]*" {
pool reward-uat5.123.com_AA2AL
}
"/A[a-lA-L]*" {
pool reward-uat5.123.com_AA2AL
}
"/a[m-zM-Z]*" {
pool reward-uat5.123.com_AM2BL
}
"/A[m-zM-Z]*" {
pool reward-uat5.123.com_AM2BL
}
"/b[a-lA-L]*" {
pool reward-uat5.123.com_AM2BL
}
"/B[a-lA-L]*" {
pool reward-uat5.123.com_AM2BL
}
"/b[m-zM-Z]*" {
pool reward-uat5.123.com_BM2CD
}
"/B[m-zM-Z]*" {
pool reward-uat5.123.com_BM2CD
}
"/c[a-dA-D]*" {
pool reward-uat5.123.com_BM2CD
}
"/C[a-dA-D]*" {
pool reward-uat5.123.com_BM2CD
}
default {
Requested URI was a leading forward slash only
pool reward-uat5.123.com_AA2AL
}
}
}
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
