IPFIX::msg

Description

Provides the ability to create, delete and set data values in an IPFIX message based on the provided IPFIX_TEMPLATE.

Syntax

IPFIX::msg create IPFIX_TEMPLATE
IPFIX::msg set IPFIX_MESSAGE IPFIX_FIELDTYPE [-pos IPFIX_POS <IPFIX_FIELDVALUE>]
IPFIX::msg delete IPFIX_MESSAGE

IPFIX::msg create IPFIX_TEMPLATE

  • Create an IPFIX_MESSAGE object based on the provided IPFIX_TEMPLATE. It is necessary to create an IPFIX_MESSAGE before filling in the values in the message. The values may be filled in from multiple events within the context of a single connection.

  • The IPFIX::msg create command returns an IPFIX_MESSAGE object which is used by the IPFIX::msg set|delete and IPFIX::destination send commands.

  • The IPFIX_TEMPLATE object is created via the IPFIX::template create command.

IPFIX::msg set IPFIX_MESSAGE IPFIX_FIELDTYPE [-pos IPFIX_POS <IPFIX_FIELDVALUE>]

  • Sets the value of a field in an IPFIX_MESSAGE. Fields are referenced by the IPFIX element type in the template.

  • If there is more than one instance of a particular IPFIX element type in a template, the optional -pos IPFIX_POS flag can be specified to set the value of the correct field in the message. IPFIX_POS starts from index 0.

IPFIX:msg delete IPFIX_MESSAGE

  • Deletes the provided IPFIX_MESSAGE. This is not generally necessary as the object is automatically destroyed when it goes out of scope.

Valid During

ANY_EVENT

Examples

when RULE_INIT {
     set static::http_track_dest ""
     set static::http_track_tmplt ""
 }

 when CLIENT_ACCEPTED {
     if { $static::http_track_dest == "" } {
        # open the logging destination if it has not been, opened yet
        set static::http_track_dest [IPFIX::destination open -publisher /common/ipfix_publisher]
     }

     if { $static::http_track_tmplt == "" } {
        # if the template has not been created yet, create the template
        set static::http_track_tmplt [IPFIX::template create "flowStartSeconds sourceIPv4Address \
                                                              tcpSourcePort destinationIPv4Address \
                                                              tcpDestinationPort action action" ]
     }
 }

 when HTTP_REQUEST {
     # create a new message for this request
     set msg [IPFIX::msg create $static::http_track_tmplt]
     #set information in the message from the http request
     IPFIX::msg set $msg flowStartSeconds [clock seconds]
     IPFIX::msg set $msg sourceIPv4Address [IP::client_addr]
     IPFIX::msg set $msg tcpSourcePort [TCP::client_port]
     IPFIX::msg set $msg action -pos 0 "Request"
 }

 when HTTP_RESPONSE_RELEASE {
     # set information in the message from the response
     IPFIX::msg set $msg destinationIPv4Address [IP::server_addr]
     IPFIX::msg set $msg tcpDestinationPort [TCP::server_port]
     IPFIX::msg set $msg action -pos 1 "Response"
     # send the message
     IPFIX::destination send $static::http_track_dest $msg
 }

Change Log

@BIGIP-11.5.0

  • First introduced the command.

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.