Forum Discussion
muzammil_88686
Nimbostratus
Nov 12, 2012Blocking Multiple URLs
Guys,
I want to block the below two URLs using iRule and also I want to log the dropped connections for both the URLs.
/xyz*
/abc
Could you pls let me know wh...
muzammil_88686
Nimbostratus
Nov 12, 2012Dear Steve,
Actually I m trying the below rule which is suggested by you as I need to send it to specific pool.
when HTTP_REQUEST {
if { switch -glob [string tolower [HTTP::path]] } {
"/xyz/bus*" -
"/xyz/car*" {
return
} }
Exit the rule
elseif { switch -glob [string tolower [HTTP::path]] } {
"/xyz*" -
"/123*" {
drop
log local0. "Dropped access attempt to [HTTP::uri] from client [IP::client_addr]"
} }
}
But I m getting the below errors.
line 2: [parse error: PARSE syntax 34 {syntax error in expression " switch -glob [string tolower [HTTP::path]] ": variable references require preceding $}] [{ switch -glob [string tolower [HTTP::path]] }]
line 3: [undefined procedure: /xyz/bus*] ["/xyz/bus*" -]
line 4: [undefined procedure: /xyz/car*] ["/xyz/car*" {
line 8: [undefined procedure: elseif] [elseif { switch -glob [string tolower [HTTP::path]] } {
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