Forum Discussion
James_124570
Mar 20, 2015Nimbostratus
Trying to change HTTP header User agent
Hi everyone!
I am trying to log the http:header user-agent to a variable using an iRule. I am trying to log exactly what broswer the client is using:(IE, FF, Chrome). Right now, the log shows: "Moz...
James_124570
Mar 27, 2015Nimbostratus
even took a step further:
if {[HTTP::header "User-Agent"] contains "Firefox"} then {
set User_agent "Firefox" }
elseif {[HTTP::header "User-Agent"] contains "Chrome"} then {
set User_agent "Chrome" }
elseif {[HTTP::header "User-Agent"] contains "Trident/5.0"} then {
set User_agent "Internet Explorer-v9.0" }
elseif {[HTTP::header "User-Agent"] contains "Trident/6.0"} then {
set User_agent "Internet Explorer-v10.0" }
elseif {[HTTP::header "User-Agent"] contains "Trident/7.0"} then {
set User_agent "Internet Explorer-v11.0" }
else {
set User_agent "Safari"
log local0. "Http_version is = $http_version"
}
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