• max_array_length : The maximum number of events to read from the log. If this item is omitted, the default is to read to the end of the log or until the read buffer is full, whichever comes first. 

To specify a starting position to audit_log_read() , pass a hash argument that includes either a start item or a bookmark consisting of timestamp  and id  items. If a hash argument includes both a start item and a bookmark, an error occurs. 

If a hash argument specifies no starting position, reading continues from the current position. 

If a timestamp value includes no time part, a time part of 00:00:00  is assumed. 

Example arguments accepted by audit_log_read() : 

•Read events starting with the first event that occurs on or after the given timestamp: 

audit_log_read(’{ "start": { "timestamp": "2020-05-24 12:30:00" } }’) 

•Like the previous example, but read at most 3 events: 

audit_log_read(’{ "start": { "timestamp": "2020-05-24 12:30:00" }, "max_array_length": 3 }’) 

•Read events starting with the first event that occurs on or after 2020-05-24 00:00:00  (the timestamp includes no time part, so 00:00:00  is assumed): 

audit_log_read(’{ "start": { "timestamp": "2020-05-24" } }’) 

•Read events starting with the event that has the exact timestamp and event ID: 

audit_log_read(’{ "timestamp": "2020-05-24 12:30:00", "id": 0 }’) 

•Like the previous example, but read at most 3 events: 

audit_log_read(’{ "timestamp": "2020-05-24 12:30:00", "id": 0, "max_array_length": 3 }’) 

•Read events from the current position in the read sequence: 

audit_log_read() 

•Read at most 5 events beginning at the current position in the read sequence: 

audit_log_read(’{ "max_array_length": 5 }’) 

•Close the current read sequence: 

audit_log_read(’null’) 

A JSON  string returned from either log-reading function can be manipulated as necessary. Suppose that a call to obtain a bookmark produces this value: 

mysql> SET @mark := audit_log_read_bookmark(); mysql> SELECT @mark; +-------------------------------------------------+ | @mark | +-------------------------------------------------+ | { "timestamp": "2020-05-18 16:10:28", "id": 2 } | +-------------------------------------------------+ 

Calling audit_log_read()  with that argument can return multiple events. To limit audit_log_read() to reading at most N  events, add to the string a max_array_length  item with that value. For example, to read a single event, modify the string as follows: 

