Forum Discussion
rdessert_76127
Dec 22, 2011Nimbostratus
TCL error - TCP connection logging iRule
I'm using the below iRule to log TCP connections through my LTM (10.2.1).
when CLIENT_ACCEPTED {
set vip [IP::local_addr]:[TCP::local_port]
}
when SERVER_CONNECTED {
...
hooleylist
Dec 22, 2011Cirrostratus
If no server connection is established, the client variable won't be set. So I assume that the log message you're getting for CLIENT_CLOSED isn't actually from that connection.
You can use the clientside command to get the virtual server (or client's destination IP:port) in a serverside event like SERVER_CONNECTED instead of saving it in CLIENT_ACCEPTED.
http://devcentral.f5.com/wiki/iRules.clientside.ashx
when SERVER_CONNECTED {
log local0.info "client: [IP::client_addr]:[TCP::client_port] -> VIP: [clientside {IP::local_addr}]:[clientside {TCP::local_port}] -> Node: [IP::server_addr]:[TCP::server_port]"
}
when CLIENT_CLOSED {
log local0.info "client: [IP::client_addr]:[TCP::client_port] -> VIP: [IP::local_addr]:[TCP::client_port]"
}
Aaron
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