Forum Discussion
Akshay_SK
May 16, 2021Nimbostratus
Log matched/detected pattern in switch statement.
I have been trying to write a security iRule for my organization that provides a basic security. Here is my code snippet where I am matching the useragent value with the provided patterns. swi...
May 16, 2021
Hello Akshay.
It's no possible to do it that way. You should differentiate each pattern.
switch -glob $useragent {
"*havij*" {
log local0. "Blocking this request due to detected user agent : *havij*"
reject
}
"*zmeu*" {
log local0. "Blocking this request due to detected user agent : *zmeu*"
reject
}
"*sqlmap*" {
log local0. "Blocking this request due to detected user agent : *sqlmap*"
reject
}
}
Regards,
Dario.
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