I am using x-forwarded-for and the web server admins would like to not see the snat ip in the logs. Currently I see both the client and snat ip. The client being 208.97.218.10 and snat 10.128.254.13. Can something be done within the x4 profile? - “Request Header Erase”? I
The XFF header is a layer 7 object, while the SNAT address is a layer 4 value. You cannot use an iRule to change the SNAT address without altering routing and potentially defeating the reason you’re using SNAT in the first place.
I would suggest tailoring the Apache log config to ignore the source address, the %h LogFormat value, and perhaps replacing it with the XFF header value \“%{X-Forwarded-For}i\”
You’re basically getting two different IP addresses in different data streams. One is coming from an HTTP header (layer 7) and the other at TCP/IP layer 3. If you don’t want the layer 3 address, then you need to configure your Apache logs to ignore this value.
if going through multiple proxies, the XFF will end up as a list instead of single IP. You’d need to split the list and select one of them (like NOT the self) and then do a header replace on XFF.