Skip to main content
POST
/
v1
/
projects
/
{project}
/
auditLogs:export
cURL
curl --request POST \
  --url https://api.example.com/v1/projects/{project}/auditLogs:export \
  --header 'Content-Type: application/json' \
  --data '
{
  "parent": "<string>",
  "filter": "<string>",
  "orderBy": "<string>",
  "format": "FORMAT_UNSPECIFIED",
  "pageSize": 123,
  "pageToken": "<string>"
}
'
{
  "content": "<string>",
  "nextPageToken": "<string>"
}

Path Parameters

project
string
required

The project id.

Body

application/json

Request message for exporting audit logs.

parent
string
required
filter
string

The filter of the log. It should be a valid CEL expression. Check the filter field in the SearchAuditLogsRequest message.

orderBy
string

The order by of the log. Only support order by create_time. For example:

  • order_by = "create_time asc"
  • order_by = "create_time desc"
format
enum<string>

The export format.

Available options:
FORMAT_UNSPECIFIED,
CSV,
JSON,
SQL,
XLSX
pageSize
integer<int32>

The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 10 log entries will be returned. The maximum value is 5000; values above 5000 will be coerced to 5000.

pageToken
string

A page token, received from a previous ExportAuditLogs call. Provide this to retrieve the subsequent page.

Response

OK

Response message for exporting audit logs.

content
string<bytes>

The exported audit log content in the requested format.

nextPageToken
string

A token to retrieve next page of log entities. Pass this value in the page_token field in the subsequent call to retrieve the next page of log entities.