Forum Discussion
Bret_McGinnis_1
Nimbostratus
Aug 22, 2005user_agent field in the http header
I would like to use the user_agent field to determine which pool a request goes to. Is there an easy or perfered way to access the user_angent field.
I looked at the doc and searched the fo...
Aug 23, 2005
You can use the HTTP::header command to get the User-Agent header.
Something like this:
when HTTP_REQUEST {
set ua [HTTP::header "User-Agent"]
log "User Agent: $ua"
if { $ua contains "MSIE" } {
log "looks like Internet Explorer"
pool pool_ie_users
} elseif { $ua contains "Firefox" } {
log "looks like FireFox"
pool pool_firefox_users
} else {
log "looks like another browser!"
pool pool_unknown_users
}
}-Joe
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