ltm rule command IPFIX destinationΒΆ

iRule(1)		      BIG-IP TMSH Manual		      iRule(1)



IPFIX::destination
       IPFIX::destination

       Provides the ability to manage IPFIX logging destinations and send
       IPFIX messages based on processing in the iRule.

SYNOPSIS
       IPFIX::destination ((open (-publisher LOG_PUBLISHER)) |
				   (close IPFIX_DESTINATION) |
				   (send IPFIX_DESTINATION IPFIX_MESSAGE))

DESCRIPTION
       Provides the ability to open and close IPFIX logging destinations in
       the context of an iRule, as well as the ability to send IPFIX messages
       to the IPFIX logging destinations.

       Syntax

       IPFIX::destination open -publisher LOG_PUBLISHER

	   * Returns an IPFIX_DESTINATION object that allows the user to send
	     messages to the specified LOG_PUBLISHER via the IPFIX::destination
	     send command.

	     It is recommended to store the resulting IPFIX_DESTINATION object
	     in a static variable so that it is accessible for all instances of
	     the rule.	If the IPFIX_DESTINATION object is not stored
	     statically, it will be opened each time the rule is executed and
	     a new IPFIX_DESTINATION object will be generated each time.

	     The LOG_PUBLISHER is a reference to a log publisher configured
	     on the BIGIP that includes a netflow or IPFIX logging destination.
	     e.g. /Common/my_log_publisher

       IPFIX::destination close IPFIX_DESTINATION

	   * Closes the specified IPFIX_DESTINATION.

       IPFIX::destination send IPFIX_DESTINATION IPFIX_MESSAGE

	   * Causes the provided IPFIX_MESSAGE to be sent to the specified
	      IPFIX_DESTINATION.  The IPFIX_MESSAGE object is created via the
	      IPFIX::msg create command, and the IPFIX_DESTINATION is created
	      vi the IPFIX::destination open command.

RETURN VALUE
       IPFIX::destination open returns an IPFIX_DESTINATION object that is
       used by the IPFIX::destination close or send command.

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" ]
	    }
	}

	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]
	}

	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]
	    # send the message
	    IPFIX::destination send $static::http_track_dest $msg
	}

HINTS
SEE ALSO
       IPFIX::template, IPFIX::msg

CHANGE LOG
       @BIGIP-11.5.0 --First introduced the command.



BIG-IP				  2017-01-31			      iRule(1)