Dan_Deming_1935
Aug 18, 2006Nimbostratus
How do I insert LB's IP with an irule?
We have 2 F5 Big IP units set up in front of 3 web servers running Apache 1.3. We're using the Type: Standard, Protocol: TCP and HTTP Profile: HTTP settings.
In our Apache logs, we want to include the IP address of the client, the IP of the server and the IP of the F5 unit. I was able to set up this irule to get the first 2:
when HTTP_REQUEST {
HTTP::header insert "Remote-Addr" [IP::remote_addr]
HTTP::header insert "Local-Addr" [IP::local_addr]
}
Adding IP::client_addr gives the same value as local_addr, and trying to use IP::server_addr actually breaks the web page: a Page cannot be displayed error is shown. I know I can hardcode in different values in the irule:
HTTP::header insert "LB" LB1
However, since we want to sync both LBs and have the exact same config on both machines, this isn't feasible. I spoke with customer support who said they knew of no unique identifier I could use, and no way to get the LB's IP. Is there any way to get this information and put it in a header? Can you use envirnonment variables in a header, so I can print the $hostname to the header?
Any help would be greatly appreciated. Thanks.