• component : A string that specifies a component name. 

• producer : A string that specifies a producer name. 

• message : A string that specifies the event message. 

• key , value : Events may include 0 or more key-value pairs that specify an arbitrary application- provided data map. Each key  argument is a string that specifies a name for its immediately following value  argument. Each value  argument specifies a value for its immediately following key  argument. Each value  can be a string or numeric value, or NULL . 

Return value: 

The string OK  to indicate success. An error occurs if the function fails. 

Example: 

mysql> SELECT audit_api_message_emit_udf(’component_text’, ’producer_text’, ’message_text’, ’key1’, ’value1’, ’key2’, 123, ’key3’, NULL) AS ’Message’; +---------+ | Message | +---------+ | OK | +---------+ 

Additional information: 

Each audit plugin that receives an event posted by audit_api_message_emit_udf()  logs the event in plugin-specific format. For example, the audit_log  plugin (see Section 6.4.5, “MySQL Enterprise Audit” ) logs message values as follows, depending on the log format configured by the audit_log_format  system variable: 

•JSON format ( audit_log_format=JSON ): 

{ ... "class": "message", "event": "user", ... "message_data": { "component": "component_text", "producer": "producer_text", "message": "message_text", "map": { "key1": "value1", "key2": 123, "key3": null } } } 

•New-style XML format ( audit_log_format=NEW ): 

<AUDIT_RECORD>  ...  <NAME>Message</NAME>  ... 

