The search-collection-audit-log-retrieve
function enables developers to programmatically retrieve audit
log information for a specific search collection and,
optionally, a specific originator. Attempting to retrieve the
audit log for a non-existent or uninitialized search
collection will generate a
SEARCH_ENGINE_OPENING_DATABASE
error. Before attempting to retrieve audit log entries from a
specified collection, you should always ensure that the
collection exists and has been initialized.
The search-collection-audit-log-retrieve
function takes the following parameters:
- collection - (Required) The name of the collection from which audit log should be retrieved.
- subcollection - (Optional) The name of the subcollection from which audit log should be retrieved, one of live or staging. If not specified, entries will be retrieved from the live subcollection.
- limit - (Optional) An integer value specifying the maximum number of audit log entries that will be retrieved. If not specified, the default number of entries returned is 1000.
- offset - (Optional) An integer value specifying the number of audit log entries to skip before retrieving audit log entries. If not specified, audit log entries will be retrieved beginning with the first entry in the audit log for the specified collection.
- originator - (Optional) Limits the audit log entries that will be retrieved to those that were enqueued with the specified originator. If an originator is not specified, audit log entries will be returned regardless of the originator that is associated with them.
Note: The limit and offset parameters are often used together to iterate through the log in fixed-size units.
This function returns an audit-log-retrieve-response node, which
is an XML element that contains some number of audit-log-entry elements. If an error
occurs, the function throws an exception. Exceptions that may
occur, and their causes, are the following:
- persister-invalid-purge-token-error - the retrieval request itself was invalid
- search-collection-invalid-name - the name of the search collection that was specified in the retrieval request does not match an existing search collection
- search-engine-opening-database-error - the retrieval request failed because it could not access the crawler's database for the specified search collection