ltm rule command MESSAGE field
iRule(1) BIG-IP TMSH Manual iRule(1)
MESSAGE::field
Various operations for a message's fields.
SYNOPSIS
MESSAGE::field ( ('names') |
('exists' NAME) |
('count' (NAME)?) |
('value' NAME (INDEX)?)
)
DESCRIPTION
This command is used for below mentioned operations for a message's field. This is valid for messages of the
following protocols:
MQTT
SIP
Syntax
MESSAGE::field names
* Returns a TCL list of all field names present in the current message for the supported protocols listed
above.
The list may contain pseudo field names such as ':uri' in addition to named fields such as SIP headers.
* It will fail when called for protocols other than the ones listed above.
MESSAGE::field exists
* Returns True when field exists. False otherwise.
Supports pseudo fields when applicable.
* It will fail when called for protocols other than the ones listed above.
MESSAGE::field count []
MESSAGE::field count
* Returns a count of all field names present in the current message for the supported protocols listed
above.
It includes any pseudo field names such as ':uri' in addition to named fields such as SIP headers.
* It will fail when called for protocols other than the ones listed above.
MESSAGE::field count
* Returns a count of all instances of the given field name if present in the current message
for the supported protocols listed above. Pseudo field names such as ':uri' are supported
in addition to named fields such as SIP headers.
* It will fail when called for protocols other than the ones listed above.
MESSAGE::field value []
MESSAGE::field value
* Get the value of the current message's field .
It will return only one of the values for a multi-instance field.
The order of the returned value within multiple instances of the field
will be protocol specific. It will be consistent with protocol specific iRule commands, if any.
* It will fail when called for protocols other than the ones listed above.
* For protocols that support this command, if the given field name is not found,
an empty string will be returned "".
MESSAGE::field value
* Get the value of the current message's field at the 0-based th index.
The order of the returned value within multiple instances of the field
will be protocol specific. It will be consistent with protocol specific iRule commands, if any.
* It will fail when called for protocols other than the ones listed above.
* For protocols that support this command, if the given field name is not found,
an empty string will be returned "".
RETURN VALUE
Returns value depends on the subcommands. See description for more details.
VALID DURING
MR_INGRESS, MR_EGRESS, and MR_FAILED.
EXAMPLES
when MR_INGRESS {
switch ( [MESSAGE::proto] ) {
"SIP" {
if { [MESSAGE::type] eq "request" } {
set uri [MESSAGE::field value ':uri']
log local0. "Message's URI is : $uri"
}
}
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-14.0.0 --First introduced the command.
BIG-IP 2020-06-23 iRule(1)