dan_19334
Jan 15, 2009Nimbostratus
Match TCP::payload to Newline
How do you match the TCP::payload to a Newline?
I would like to load balance individual syslog messages across a pool of servers. The syslog client connects to the VIP and maintains a persistent TCP connection and sends many syslog messages, I would like to take each message and send to a different backend node.
This is the iRule I am using to perform this function but can't seem to figure out how to collect until a newline is read.
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
if { [TCP::payload] contains "\x0D\x0A" } {}
if { [TCP::payload] contains "\r\n" } {
LB::detach
TCP::release
TCP::collect
}
}
Thanks,
-Dan