25-Apr-2010
15:04
- last edited on
31-May-2023
14:54
by
JimmyPackets
when CLIENT_ACCEPTED{
TCP::collect
}
This section collects the first 6 bytes and then uses 'switch' to find a match.
It allows to you decide where to send a request based on its message type.
You could also use this to simply log without performing a pool selection.
when CLIENT_DATA {
log local0. "in CLIENT_DATA"
set clientData [TCP::payload 6]
log local0. "Client Data raw: $clientData"
switch -glob $clientData{
"??0800"{
pool pool_EchoTestMessage
log local0. "This is a Network Management Message."
}
"??0810"{pool pool_ForClientAuthorizations}
}
TCP::release
}
when SERVER_CONNECTED {
TCP::collect
}
This section allows you to perform an action base on the message type of the response from the server.
You could log the message type or even manipulate it before sending it out.
when SERVER_DATA{
set serverData [TCP::payload 6]
log local0. "Response Data raw: $serverData"
switch -glob $serverData{
"??0810"{
log local0. "This is a Network Management Message."
}
"??0820"{log local0. "This is type XXX"
}
}
TCP::release
}
24-May-2010 06:14
However, if you are looking for something that can access the full payload, please see the post:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/71/afv/topic/aft/1172446/aff/2297/showtab/groupforums/Default.aspx