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 {
set client "[IP::client_addr]:[TCP::client_port]"
set node "[IP::server_addr]:[TCP::server_port]"
log local0.info "client: $client -> VIP: $vip -> Node: $node"
}
when CLIENT_CLOSED {
log local0.info "client: $client -> VIP: $vip -> Node: $node"
}
The LTM is logging an error message...
local/tmm1 err tmm1[4954]: 01220001:3: TCL error: TCP_Logging_All_Others - can't read "client": no such variable while executing "log local0.info "client: $client -> VIP: $vip -> Node: $node""
In spite of logging the error message, it still logs the CLIENT_CLOSED info.
Rule TCP_Logging :: client: 128.200.110.4%9:56334 -> VIP: x.x.x.x%9:443 -> Node: x.x.y.x%969:443
I'm trying to figure out why the error is ocurring and how to make it stop. I'm also curious why its actually logging a CLIENT_CLOSED event if it can't read the "client" variable.
Thanks for any help!
- hooleylistCirrostratusIf 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.
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]" }
- rdessert_76127NimbostratusThanks Aaron, the rule you provided works great.
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