ltm rule event MQTT CLIENT DATAΒΆ

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



MQTT_CLIENT_DATA
       An iRule event that triggers when an a prior MQTT::collect command
       finishes.

DESCRIPTION
       This iRule event triggers when payload data collection invoked using
       MQTT::collect iRule command finishes. This iRule event is for client-
       side.

Examples
	#Example: Redirect PUBLISH that has payloads with blocked keywords defined in
	#blacklisted_keywords_datagroup in first 200 bytes. Prepend a admin message in
	#the payload.
	#
	when MQTT_CLIENT_INGRESS {
	    set type [MQTT::type]
	    switch $type {
	       "PUBLISH" {
		  if { [class exists  blacklisted_keywords_datagroup] } {
		     MQTT::collect 200
		  }
	       }
	    }
	}

	when MQTT_CLIENT_DATA {
	   set type [MQTT::type]
	   switch $type {
	       "PUBLISH" {
		  set payload [MQTT::payload]
		  set found [class match $payload contains blacklisted_keywords_datagroup]
		  if { $found != "" } {
		     set topic [MQTT::topic]
		     MQTT::topic "/bigip/quarantined/$topic"
		     MQTT::payload prepend "!!!!!! QUARANTINED Message !!!!!!"
		  }
		  MQTT::release
	       }
	   }
	}

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-13.0.0
	   --First introduced the event.



BIG-IP				  2018-07-19			      iRule(1)