Forum Discussion
Stanislas_Piro2
Apr 28, 2016Cumulonimbus
Hi,
you can use the following irule to add username in request logging profile:
when CLIENT_ACCEPTED {
set APMusername "-"
}
when ACCESS_ACL_ALLOWED {
if {![info exists APMusername] || $APMusername equals "-"} {
set APMusername [ACCESS::session data get session.logon.last.username]
}
}
when HTTP_RESPONSE {
if [info exists APMusername] {
HTTP::header insert "USER" APMusername
}
}
when HTTP_RESPONSE_RELEASE {
HTTP::header remove "USER"
}
This irule must be enabled associated with Request_logging profile.
The Request logging profile may be configure with following Response Profile:
$CLIENT_IP - ${USER} $DATE_NCSA $HTTP_REQUEST $HTTP_STATCODE $RESPONSE_SIZE $Referer 0 $Cookie