Forum Discussion
Algebraic_Mirror
Cirrostratus
Apr 09, 2018How can I get the X-Forwarded-For IP to show up in APM Reports?
What is the best way to get the X-Forwarded-For address of a client to show up in APM reports? For example, in v13.1, if you go to Access -> Overview -> Reports, and choose a 1 hour time period, it s...
youssef1
Cumulonimbus
Apr 10, 2018Hello, You right we can optimise this Irule, try this:
when HTTP_REQUEST {
if { [HTTP::cookie exists MRHSession] and [HTTP::cookie exists LastMRH_Session] } {
set apm_cookie [HTTP::cookie MRHSession]
if { (![ACCESS::session exists -sid $apm_cookie]) or ([ACCESS::session exists -sid $apm_cookie] and [ACCESS::session data get -sid $apm_cookie session.policy.result] == "in_progress" ) or ([ACCESS::session exists -sid $apm_cookie] and [ACCESS::session data get -sid $apm_cookie session.policy.result] == "not_started" ) } {
if {[HTTP::header exists X-Forwarded-For]}{
set userip [HTTP::header X-Forwarded-For]
ACCESS::session data set session.user.clientip $userip
}
}
}
}
you can also test this irula by removing this condition:
(![ACCESS::session exists -sid $apm_cookie])
Let me now it it's work for you or if you need explanation about this irule
regards
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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