Forum Discussion
Logging client connections to syslog
Due to a network design requirement, we are required to source-nat all connections to our LTMs. Because of this we are unable to determine what time a specific client IP connected to our servers.
What we would like to do is send out syslog messages for each new socket and each reset. Our system is socket oriented and our customers generally stay on the same socket for hours, if not days. So it shouldn't be a lot of traffic. However I can't seem to figure out how to get the boxes to send out this information.
I would prefer not to log this information locally as it is just a disk space waster on LTM.
Thanks in advance for any advice.
- hoolio
Cirrostratus
Hi Brian,From: http://devcentral.f5.com/wiki/default.aspx/iRules/HSL__send.html when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool syslog_pool] } when SERVER_CONNECTED { set log_line "[IP::client_addr]:[TCP::client_port] <-> [clientside {IP::local_addr}]:[clientside {TCP::local_port}] [IP::local_addr]:[TCP::local_port] <-> [IP::server_addr]:[TCP::server_port]" } when CLIENT_CLOSED { Log connection details as local7.info; see RFC 3164 Section 4.1.1 - "PRI Part" for more info HSL::send $hsl "<190> $log_line" }
- David_Noonan_67
Nimbostratus
The above script didn't work for me (LTM 10.2.1) until I tweaked it a bit.From: http://devcentral.f5.com/wiki/default.aspx/iRules/HSL__send.html when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool syslog-pool] } when SERVER_CONNECTED { set FrontEnd "[IP::client_addr]:[TCP::client_port] <-> [clientside {IP::local_addr}]:[clientside {TCP::local_port}]" set BackEnd "[IP::local_addr]:[TCP::local_port] <-> [serverside {IP::remote_addr}]:[TCP::server_port]" Log connection details as local7.info; see RFC 3164 Section 4.1.1 - "PRI Part" for more info HSL::send $hsl "<190> HSL: $FrontEnd | $BackEnd" }
- James_124570
Nimbostratus
Is it really a good idea to attach an iRule to that scans every packet to a production virtual server? There has to be a better. Just my thoughts. - vlad94103_22344
Nimbostratus
Bump up. Re: Logging the sessions with session ID binding the server- and client- sides.
- David_Noonan_67
Nimbostratus
Does anyone know of any issues that might be caused by moving the logging to SERVER_CONNECTED? - nitass
Employee
[root@edelweiss:Active] config b version|grep -iA 1 version - vlad94103_22344
Nimbostratus
Bumping up. Logging the sessions with session ID binding the server- and client- sides.
Recent Discussions
Related Content
* 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