Updated Date: 07/07/2026
Message Creation
The data stream will need to be parsed during CLIENT_DATA and SERVER_DATA iRule events for messages. Once the bytes of a message has been collected, a message object will need to be created and populated.
The GENERICMESSAGE::message create command is used to create and populate a message.
Once a message is created, the GENERICMESSAGE_INGRESS event will be raised and the script author may modify and the message.
Upon completion of the GENERMESSAGE_INGRESS event, the message will be forwarded to the router for routing.
An example script that parses the input stream to create message follows. This example identifies a request message as having the destination address specified at the start of the message separated from the data of the message by a ‘:’.
when CLIENT_DATA {
set lines [split [TCP::payload] "\n"]
TCP::payload 0 0
foreach line $lines {
set line [string trim $line]
if { [string length $line] > 0 } {
if { $capture_name == 1 } {
...
} else {
set tokens [split $line ":"]
if {[llength $tokens] > 1} {
GENERICMESSAGE::message create [join [lrange $tokens 1 end] ":"] [lindex $tokens 0]
} else {
GENERICMESSAGE::message create $line
}
}
}
}
TCP::release
TCP::collect
}
when SERVER_DATA {
set lines [split [TCP::payload] "\n"]
TCP::payload 0 0
foreach line $lines {
set line [string trim $line]
if { [string length $line] > 0 } {
if { $capture_name == 1 } {
...
} else {
set tokens [split $line ":"]
if {[llength $tokens] > 1} {
GENERICMESSAGE::message create [join [lrange $tokens 1 end] ":"] [lindex $tokens 0]
} else {
GENERICMESSAGE::message create $line
}
}
}
}
TCP::release
TCP::collect
}