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...
ssievers_87378
Mar 20, 2015Nimbostratus
when HTTP_REQUEST {
if {[HTTP::header "User-Agent"] contains "Firefox"} then {
set user_agent "Firefox" }
elseif {[HTTP::header "User-Agent"] contains "Chrome"} then {
set user_agent "Chrome" }
else {
set user_agent "IE"
}
log local0. "User Agent is: $user_agent"
}
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