Forum Discussion
TMcGov_92811
Nimbostratus
Jan 29, 2009Help with simple iRule to log client IP
Hi, I wish to create an IRule that can be used in troubleshooting issues with particular source IPs. It would be applied to a VS only during troubleshooting. Specifically I want to match on a source IP, then log only that session in terms of selected pool and member. The "log" section works fine under SERVER_CONNECTED, but when I add the "if" statement I get syntax error messages.
when SERVER_CONNECTED {
if {[IP::client_addr] equals 10.10.10.10} {
log local0. "Client Source IP: [IP::client_addr]:[TCP::client_port]<-->POOL<-->[LB::server]<-->ACTUALNODE<-->[IP::server_addr]:[TCP::server_port]"
}
}
- Colin_Walker_12Historic F5 AccountThe syntax looks pretty close. You'll want to use the IP::addr command, but that shouldn't cause the syntax error. What error are you getting?
when SERVER_CONNECTED { if { [IP::addr [IP::client_addr] equals 10.10.10.10] } { log local0. "Client Source IP: [IP::client_addr]:[TCP::client_port]<-->POOL<-->[LB::server]<-->ACTUALNODE<-->[IP::server_addr]:[TCP::server_port]" } }
- TMcGov_92811
Nimbostratus
That took care of it - thanks again.
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