Forum Discussion
K-Dubb
Nimbostratus
Nov 29, 2010Add http header of Server IP address?
Hello,
We are on version 9.4.8 of BigIP. We use a device called Truesight to monitor the user experience of our traffic. We recently moved the Truesight device to in front of the F5 so we ...
hoolio
Cirrostratus
Dec 02, 2010The iRule is inserting the HTTP header in requests sent to the pool, so the client wouldn't see the change. You could either log the change in the iRule, use tcpdump on the server VLAN or check the server logs if they log the custom HTTP header.
Here's a way to log the specific header as well as the full HTTP request headers in the iRule:
From http://devcentral.f5.com/wiki/default.aspx/iRules/http_request_send
when HTTP_REQUEST_SEND {
Need to force the host header replacement and HTTP:: commands into the clientside context
as the HTTP_REQUEST_SEND event is in the serverside context
clientside {
Replace (or insert if it doesn't exist) a custom HTTP header with the selected server IP and port
HTTP::header replace my_custom_header "[IP::server_addr]:[TCP::server_port]"
}
}
when HTTP_REQUEST_SEND priority 501 {
Run this event with a later priority than the default HTTP_REQUEST_SEND event
This bypasses LTM's caching of most HTTP:: commands within the same event and event priority
clientside {
log local0. "[IP::client_addr]:[TCP::client_port]: my_custom_header: [HTTP::header my_custom_header]"
log local0. "[IP::client_addr]:[TCP::client_port]: All headers: [HTTP::request]"
}
}
You can remove the second HTTP_REQUEST_SEND event once you're done testing.
For details on using tcpdump to capture this, see SOL411:
SOL411: Overview of packet tracing with the tcpdump utility
http://support.f5.com/kb/en-us/solutions/public/0000/400/sol411.html
Aaron
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
