Search Audit Logs for an Enterprise
This method enables users to query the audit logs for a specified enterprise. Events include what action was performed, who performed the action, and when the action was performed.
For more information on the GitHub Audit logs API, see Here (opens in a new tab).
To use this API endpoint, your GitHub token requires the following scopes:
- audit_log
SDK Import:
from admyral.actions import search_github_enterprise_audit_logs
Arguments
Argument Name | Description | Required |
---|---|---|
Enterprise enterprise | Search Audit Logs for specified enterprise. | yes |
Filter filter | Filter the audit logs, see Here (opens in a new tab) for additional information. | - |
Start Time start_time | The date and time to start retrieving events in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). If not specified, all available Audit logs will be returned | - |
End Time end_time | The date and time to stop retrieving events in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). | - |
Limit limit | The maximum number of events to retrieve. | - |
Returns
A JSON array of audit log events.
For more information about possible audit log events, see Get the audit log for an enterprise (opens in a new tab).
Required Secrets
Secret Placeholder | Description |
---|---|
GITHUB_ENTERPRISE_SECRET | GitHub enterprise secret. See GitHub setup |
SDK Example
audit_log_entries = search_github_enterprise_audit_logs(
enterprise="admyral",
filter="action:org.update_member",
secrets={"GITHUB_ENTERPRISE_SECRET": "my_stored_github_enterprise_secret"}
)