Forum Discussion
youssef1
Aug 19, 2018Cumulonimbus
Hi,
as defined here: https://developers.whatismybrowser.com/useragents/explore/operating_system_name/mac-os-x/
mac os user agent seems to (don't take care about version):
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7
when HTTP_REQUEST {
set useragent [HTTP::header value User-Agent]
set tolower_useragent [string tolower [HTTP::header value User-Agent]]
if {$useragent contains "Mac OS X" or $tolower_useragent contains "mac os x"} {
log local0. "User Agent Info: $useragent - $tolower_useragent"
reject
}
}
If it'w not working can you test the following irule (with regex for blank space):
when HTTP_REQUEST {
set useragent [HTTP::header value User-Agent]
if {$useragent matches_regex {.*(?i)mac.os.x.*} } {
log local0. "User Agent Info: $useragent"
reject
}
}
Hope it help you, keep me in touch if it's working.
regards