Forum Discussion
iRule to Rewrite User Agent Header
I've updated the rule and was able to figure out the syntax errors; however I'm getting the following the logs.
when HTTP_REQUEST {
Rewrite the User-Agent header value to show up supported browser
log local0. "[HTTP::header User-Agent]" if { [string toupper [HTTP::header "User-Agent"]] contains "MSIE 6" or "MSIE 7" or "MSIE 8" or "MSIE 9" or "MSIE 10"}{
Replace the User-Agent header with supported user agent
HTTP::header replace "User-Agent" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko" log local0. "[HTTP::header User-Agent]" } }
Mar 31 18:01:20 f5-ve info tmm1[20879]: Rule /Common/HTTP-UserAgentHeader-Rewrite-iRule : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; InfoPath.3; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0E; .NET4.0C) Mar 31 18:01:20 f5-ve err tmm1[20879]: 01220001:3: TCL error: /Common/HTTP-UserAgentHeader-Rewrite-iRule - can't use non-numeric string as operand of "||" while executing "if { [string toupper [HTTP::header "User-Agent"]] contains "MSIE 6" or "MSIE 7" or "MSIE 8" or "MSIE 9" or "MSIE 10"}{ Replace the User-Agent header..."
Recent Discussions
Related Content
* 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