Forum Discussion
Robert_47833
Jun 01, 2011Altostratus
wanna record user_agent from specific client ip
Hi
I have a requirement
it seems impossible
we want to record user_agent from some specific client ip
when CLIENT_ACCEPTED {
if
{ [IP::addr [IP::client_addr] equals 174.76.19.40] }
{ log local0. " 174.76.19.40 uses [HTTP::header value user_agent]" }
}
this irule doesn't work,because HTTP::header can't be used in CLIENT_ACCEPTED event
How should I do to achieve this goal
- Robert_47833Altostratusok,yes,it will affect the process,
- hooleylistCirrostratusThanks for confirming. It's generally a good idea to ensure variables are set in all cases. Or you can use info exists to check. But it's additional complexity with little benefit.
when CLIENT_ACCEPTED { if { [IP::addr [IP::client_addr] equals 174.76.19.40] } { set log_ua 1 } } when HTTP_REQUEST { if { [info exists log_ua] && $log_ua == 1 } { log local0. " 174.76.19.40 uses [HTTP::header value user_agent]" } }
- Robert_47833Altostratusyes,I will follow your instructions to add else
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