Forum Discussion
client connection persistence using an irule
can this irule work when i see the iv- remote address in the header , I need source IP persistence for that iv-remote address.
when HTTP_REQUEST {
if {[info exists clientIp]} {
persist uie $clientIp
} elseif {[HTTP::header exists "header iv-remote-address"]} {
set clientIp [HTTP::header value "header iv-remote-address"]
}
}
when HTTP_RESPONSE {
if {[info exists clientIp]} {
persist add uie $clientIp
}
}
- Lee_SutcliffeSep 03, 2019Nacreous
Sorry for late reply, I've been away. Your header name doesn't look right, you can't have whitespace in the header name, I think you mean
[HTTP::header exists "iv-remote-address"]
Other than that it should be fine, just try it by replacing "client-ip" in my iRule example and with the name of the header you're looking for.
- Sam10Sep 05, 2019Altostratus
applied this to the uie profile.
when HTTP_REQUEST {
if {[HTTP::header does exists iv-remote-address]} {
persist uie [HTTP::header value iv-remote-address]
}
}
when HTTP_RESPONSE {
if {[HTTP::header exists iv-remote-address]} {
persist add uie [HTTP::header value iv-remote-address]
}
}
and trying to apply this to the VS config and running into syntax errors.
when HTTP_REQUEST {
if { [HTTP::header exists "iv-remote-address"] } {
log local "iv-remote-address is [HTTP::header value iv-remote-address]
persist uie [HTTP::header value iv-remote-address] }
else {
log local "persist on[IP::client_addr]
persist uie [IP::client_addr] }
}
Recent Discussions
Related Content
* 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