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] ...
Robert_47833
Jun 02, 2011Altostratus
yes,I will follow your instructions to add else
by the way, can I use else in this synatx:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 174.76.19.40] } {
set log_ua 1
} else {set log_ua 0}
}
when HTTP_REQUEST {
if { $log_ua == 1 } {
log local0. " 174.76.19.40 uses [HTTP::header value User-Agent]"
} else { $log_ua == 0 }
{log local0. "[IP::client_addr] uses [HTTP::header value User-Agent]"}
}
it seems it doesn't work,so it is not allowed to add match condition after else ,right?
but irule below does work.
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 174.76.19.40] } {
set log_ua 1
} else {set log_ua 0}
}
when HTTP_REQUEST {
if { $log_ua == 1 } {
log local0. " 174.76.19.40 uses [HTTP::header value User-Agent]"
} elseif { $log_ua == 0 } {log local0. "[IP::client_addr] uses [HTTP::header value 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