I need some ideas on the best way to log the pool member selected during a connection. The user is under the impression x-forwarded will solve their problem… We’re not using SNAT here so we’re already preserving the source address… its the destination address (pool member) they want…
I was thinking of using the LB::server addr command. Any other thoughts or ideas? Or is that the best way to accomplish what I need here.
Cool, I’m looking to make it easy for them to view..
Could I insert it in the header so the web server admins could pull the info out without gaining access into our logs.
ty
Interesting question…you insert a header on the way to the server…in this case, you haven’t picked a server yet…anyone have a good way to do this? I know how to easily do it in the HTTP Response…
Hmm but you have picked the server…correct? Instead of capturing it into the log file, I was wondering if it could take the place of the x-forwarded in the header…
I’ll give everyone a little more background so it makes more sense… we’re actually mirroring outside VIP vlan and capturing it with a monitoring tool… We’d like to decipher which pool member a session is on so we can pinpoint issues..
when HTTP_REQUEST_SEND {
Need to force HTTP:: commands into the clientside context as the
HTTP_REQUEST_SEND event is in the serverside context
clientside {
Insert a custom HTTP header in the request headers with the selected server IP
HTTP::header insert Selected-Server [LB::server addr]
}
}
You could use just [LB::server] to get the pool name, IP and port instead of just the member IP with [LB::server addr].
when HTTP_REQUEST_SEND {
Need to force HTTP:: commands into the clientside context as the
HTTP_REQUEST_SEND event is in the serverside context
clientside {
Insert a custom HTTP header in the request headers with the selected server IP
HTTP::header insert Selected-Server [LB::server addr]
}
}
You could use just [LB::server] to get the pool name, IP and port instead of just the member IP with [LB::server addr].
Aaron
Nice Aaron! Is there a list somewhere that has the order in which the iRule events are processed? Obviously LB::server addr wouldn’t be valid until the member is chosen…so does this get executed right after LB::selected?
I haven’t seen anything comprehensive. What in particular are you looking for? It would almost need to be programmatic in order to cover all of the potential paths.
Or you could just add a log statement in every event and add it to your virtual server. You’d need to comment out the events which aren’t relevant for your VS config to get the rule to load.
We have an internal discussion between the SE’s about creating a new TMM architectural flow diagram. I’ll see if we can publish something based on that once it’s complete.