Forum Discussion
royceking_18057
May 29, 2015Cirrus
iRule to block multiple user agents.
I have this clunky iRule to block unwanted user agent bots that I have identified hit our site. Unfortunately it is a pain to manage. Is there a better way to write this and not have to use a big i...
royceking_18057
May 29, 2015Cirrus
I think I figured it out. I needed to add the match after the class.
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::header "User-Agent"]] contains user_agent_blacklist ] } {
log local0. "User_agent [HTTP::header "User-Agent"] is blacklisted. from: [IP::client_addr] "
drop
return
}
}
Seems to be working now.
Thanks for the help.
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