Forum Discussion
Ryan_M_362715
Feb 12, 2019Altocumulus
Logging APM Username and XFF Address
I'm trying to create a single log entry that is triggered by an ACCESS_POLICY_AGENT_EVENT containing a user's username (after successful logon) and their X-Forwarded-For address. This log needs to be triggered immediately after successful authentication. Here is my iRule:
when ACCESS_POLICY_AGENT_EVENT {
log local0. "SESSION_STARTED, User=[ACCESS::session data get session.logon.last.username], IP=[HTTP::header X-Forwarded-For]"
}
However, I'm getting this as my log entry:
Rule /Common/UserID_Logger : SESSION_STARTED, User=testuser, IP=
It seems that the http headers are not accessible from within the APM event. Any suggestions?
- Stanislas_Piro2Cumulonimbus
Use this code
when ACCESS_SESSION_STARTED { ACCESS::session data set session.custom [HTTP::header X-Forwarded-For] } when ACCESS_POLICY_COMPLETED { log local0. "SESSION_STARTED, User=[ACCESS::session data get session.logon.last.username], IP=[ACCESS::session data get session.custom.xff]" }
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