Forum Discussion
Xin_99652
Nimbostratus
Feb 23, 2015IRules and Data Group
We need to reject some HTTP request based on User-Agent.
We have a iRule that works, I would like to rewrite it by using Data Group.
when HTTP_REQUEST {
if {([string tolower [HTTP::header "Us...
nathe
Cirrocumulus
Feb 23, 2015when HTTP_REQUEST {
switch -glob [string tolower [HTTP::header User-Agent]] {
"*majestic12*" -
"*yandex*" -
"*ahrefs*" -
"*yisou*" -
"*teoma*" {
reject
log local0. "Blocked src=[IP::client_addr] src_port=[TCP::client_port],agent= [HTTP::header User-Agent]"
}
}
}
By the way, this is a cleaner irule. Not checked syntax though.
N
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
