Export all logs and audit logs to SQL database for querying