Forum Discussion
AdityaVyas_3582
Nimbostratus
Apr 11, 2018How to capture the last ip address written in my x forwarded for header.
Hi, i want to capture the last ip address written in my x forwarded for header which is the proxy ip for my organisation. I wanted to use this ip in an irule to do some other stuff. How i can achieve...
iaine
Nacreous
Apr 11, 2018Hi
Assuming that your XFF header has a common delimiter eg comma, then you could use something like this
when HTTP_REQUEST {
if {HTTP::header exists X-Forwarded-For } {
Logic assumes that the header is delimited with a comma
set xff [string trim [lindex [split [HTTP::header values X-Forwarded-For] ,] end]]
log local0. "XFF Last Entry = $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