Forum Discussion
Matt_Breedlove_
Jul 17, 2012Nimbostratus
switch glob tcl string match support
Hi All
When using switch -glob, I know it supports square bracket char ranges such as [a-f], but does it support either of these?
Either "a" or "d" or "f"
[a,d,f]
o...
Matt_Breedlove_
Jul 19, 2012Nimbostratus
Hi Aaron,
This is the irule as it currently is and while the /vz and /spf parts are working, the redirects just hang...no redirect as expected.
I saw your comment on not having the commas so I will remove those, but it sounds like it just means that comma's are part of the set now that would match, but commas aren't present incidentally so no harm no foul on the commas in terms of the functionality issue?
Please let me know if anything is wrong with this. LTM version is 10.2.0
when HTTP_REQUEST {
set pool8777 "suia-p.testms1_8777"
switch -glob [URI::decode [string tolower [HTTP::uri]]] {
"*/vz*" { return }
"/csp*xpf=7*" { if { [class match [string tolower [HTTP::header "User-Agent"]] contains sms1p_ua_blacklist] } {
drop
} else {
return
}
}
"/spf/*" { pool $pool8777 }
"/csp*f[a-c][a-e]*[b-c]*o*k" -
"/csp*kw=??aceb*k" -
"/csp*kw=?aceb*k" -
"/csp*f[a-b][c-j][b-e]*oo" -
"/csp*f[a-b][l-n][b-e]*oo" -
"/csp*kw=fb[&, ,.]" -
"/csp*f?a?c?e" { HTTP::redirect "http://cs.testams1.com/spf/cs_sms1_facebook.asp?[HTTP::uri]" }
"/csp*kw=goo[&, ,.]" -
"/csp*[g,6][e,o,0][g,o,0,r][g,l,o]ul" -
"/csp*[g,6][e.o.0][g,o,0,r]gl" -
"/csp*[g,6][e,o,0][g,o,0][g,l,o][e,g,l,o]" { HTTP::redirect "http://cs.testams1.com/spf/cs_sms1_google.asp?[HTTP::uri]" }
default { if { [class match [string tolower [HTTP::header "User-Agent"]] contains sms1p_ua_blacklist] } {
drop
} else {
return
}
}
}
}
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