Mariusz_B
Feb 09, 2015Nimbostratus
Logging all traffic iRule.
Hello,
I have the following iRule for logging all traffic:
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]"
set snat "[IP::local_addr]:[TCP::local_port]"
}
when CLIENT_CLOSED {
log connection info
log local0.info "Client $client -> VIP: $vip -> SNAT: $snat -> Node: $node"
}
I have tested this on a virtual F5 which worked fine, however for some reason on a production LTM, I get the following error in the logs:
TCL error: /Common/Source_IP_Logging - can't read "client": no such variable while executing "log local0.info "Client $client -> VIP: $vip -> SNAT: $snat -> Node: $node""
From time to time it works fine on the production one as well. 1. Should I try to move my client variable definition to "when CLIENT_ACCEPTED" section? 2. Should I use double quotes for variable definition, or make all of them like the "vip" one?
Regards
Mariusz