Understanding audit logs

This page describes audit log entries in detail: their structure, how to read them, and how to interpret them.

Cloud Audit Logs maintains three audit logs for each Google Cloud project, folder, and organization:

  • System Event audit logs
  • Admin Activity audit logs
  • Data Access audit logs

For a general overview of Cloud Audit Logs, see Cloud Audit Logs.

Format of audit log entries

An audit log entry is a type of Cloud Logging log entry. Like all Logging log entries, an audit log entry is stored in a LogEntry object. What distinguishes an audit log entry from other log entries is the protoPayload field. In audit log entries, the log entry's protoPayload field contains an AuditLog object that stores the audit logging data.

In short, every audit log entry is characterized by the following information:

  • The project or organization that owns the log entry.
  • The resource to which the log entry applies. This information consists of a resource type from the Monitored resource list and additional values that denote a specific instance. For example, you can view audit log entries from a single Compute Engine VM instance or from all VM instances.
  • A timestamp.
  • A Service: Services are individual Google Cloud products, such as Compute Engine, Cloud SQL, or Pub/Sub. Each service is identified by name: Compute Engine is compute.googleapis.com, Cloud SQL is cloudsql.googleapis.com, and so forth. This information is listed in the protoPayload.serviceName field of the audit log entry.

    Resource types belongs to a single service, but a service can have several resource types. For a list of services and resources, go to Mapping services to resources.

  • A payload, which is the protoPayload type. The payload of each audit log entry is an object of type AuditLog, which defines a set of fields specific to audit logging, such as serviceName and authenticationInfo. It also has an optional field, serviceData, that some Google Cloud services use to list service-specific information in the audit log entry. See Service-specific audit data for a list of Google Cloud services that use this field.

  • Log name: Audit log entries belong to logs within projects, folders, and organizations. The log names are listed below:




Within a project, folder, or organization, these log names are typically abbreviated activity, data_access, and system_event.

Sample audit log entry

This section uses a sample audit log entry to explain how to find the most important information in audit log entries.

The following sample is an Admin Activity audit log entry written by Resource Manager to record a change to an Cloud Identity and Access Management policy in a Google Cloud project named my-gcp-project-id. For brevity, some parts of the log entry are omitted, and some fields are highlighted:

      protoPayload: {
        @type: "type.googleapis.com/google.cloud.audit.AuditLog",
        status: {},
        authenticationInfo: {
          principalEmail: "user@example.com"
        serviceName: "appengine.googleapis.com",
        methodName: "SetIamPolicy",
        authorizationInfo: [...],
        serviceData: {
          @type: "type.googleapis.com/google.appengine.legacy.AuditData",
          policyDelta: { bindingDeltas: [
              action: "ADD",
              role: "roles/logging.privateLogViewer",
              member: "user:user@example.com"
          ], }
        request: {
          resource: "my-gcp-project-id",
          policy: { bindings: [...], }
        response: {
          bindings: [
              role: "roles/logging.privateLogViewer",
              members: [ "user:user@example.com" ]
      insertId: "53179D9A9B559.AD6ACC7.B40604EF",
      resource: {
        type: "gae_app",
        labels: { project_id: "my-gcp-project-id" }
      timestamp: "2019-05-27T16:24:56.135Z",
      severity: "NOTICE",
      logName: "projects/my-gcp-project-id/logs/cloudaudit.googleapis.com%2Factivity",

Here is the query that was used to select the audit log entry sample above. It can be used in the Advanced Logs Viewer, Logging API, or Cloud SDK. The project identifier is in the log's name, and the query is fast because the logName field is indexed:

    resource.type = "gae_app"
    logName = "projects/[PROJECT_ID]/logs/cloudaudit.googleapis.com%2Factivity"

If you are looking for audit logs from a single instance of a resource type, such as gce_instance, add an instance qualifier:

    resource.type = "gce_instance"
    resource.instance_id = "[INSTANCE_ID]/
    logName = "projects/[PROJECT_ID]/logs/cloudaudit.googleapis.com%2Factivity"

Interpreting the sample audit log entry

In the audit log entry sample above, the protoPayload, insertId, resource, timestamp, severity and logName fields shown are part of the LogEntry object. The value of the protoPayload field is an AuditLog object. It encapsulates the audit logging data.

Looking at the audit log entry sample above, you might have some questions:

  • Is this an audit log entry? It is, which you can tell in two ways:

    • The protoPayload.@type field is type.googleapis.com/google.cloud.audit.AuditLog.

    • The logName field includes the domain cloudaudit.googleapis.com.

  • What service wrote the audit log? The log was written by App Engine. This information is listed in the protoPayload.serviceName field of the audit log entry.

  • What operation is being audited? SetIamPolicy, as specified in the protoPayload.methodName field, is being audited. More information about the audited operation is in the AuditData object in protoPayload.serviceData.

  • What resource is being audited? An application running in App Engine, associated with a Google Cloud project my-gcp-project-id, is being audited. You can determine this from the resource field, which specifies the resource type gae_app and the project identifier my-gcp-project-id. In this example, you would find details on the resource type in the monitored resource type list.

For more information, see the LogEntry type, the AuditLog type, and the IAM AuditData type.

Large or long-running audit log entries

A single audited operation splits across multiple log entries if the operation runs asynchronously or if it generates a large AuditLog record. When there is more than one log entry for the same operation, the LogEntry object will contain an operation field and the entries for the same operation will have the same value for LogEntry.operation.id and LogEntry.operation.producer.

In the preceding audit log entry sample, the operation field is not present, meaning that all the audit information is contained in a single log entry.

Service-specific audit data

Some services extend the information stored in their AuditLog by placing a supplementary data structure in the audit log's serviceData field. The following table lists the services that use serviceData field and provides a link to their AuditData type.

Service Service data type
App Engine type.googleapis.com/google.appengine.v1.AuditData
App Engine (legacy) type.googleapis.com/google.appengine.legacy.AuditData
BigQuery type.googleapis.com/google.cloud.bigquery.logging.v1.AuditData
Cloud Identity and Access Management type.googleapis.com/google.iam.v1.logging.AuditData

Viewing audit logs

To find and view audit logs, you need to know the identifier of the Google Cloud project, folder, or organization for which you want to view audit logging information. You can further specify other indexed LogEntry fields, like resource.type; for details, review Finding log entries quickly.

Here are the audit log names:




The examples below use project-level queries. If you wish to look at audit logs at the organization level or folder level, substitute the appropriate folder-level or organization-level audit log name or identifiers as listed in the audit log names.

You have several options for viewing your audit log entries.

Cloud Console

You can use the Logs Viewer in the Cloud Console to retrieve your audit log entries for your Google Cloud project. Do the following:

  1. Go to the Google Cloud's operations suite Logging > Logs (Logs Viewer) page in the Cloud Console:

    Go to the Logs Viewer page

  2. Select an existing Google Cloud project at the top of the page, or create a new project.

  3. In the first drop-down menu, select the resource type whose audit logs you wish to see.

  4. In the second drop-down menu, select the log type you want to see: activity for Admin Activity audit logs,data_accessfor Data Access audit logs, and system_events for System Event logs.

    If you don't see any of those options, then there are no audit logs of that type available in the project.

If you want to restrict an existing search to only audit logs, do the following:

  1. On the search-filter box, click the drop-down arrow (▾) and select Convert to advanced filter.

  2. In the text box that appears, add the following query below the resource.type line. Note that the project-id you supply must refer to the currently selected Google Cloud project; otherwise, the query won't work.

        logName : "projects/project-id/logs/cloudaudit.googleapis.com"

    If you want to see all the available audit logs for your project, only include the above in your query. For more details about queries, see Advanced logs queries.


To look at your audit log entries using the Logging API, do the following:

  1. Go to the Try this API section in the documentation for the entries.list method.

  2. Put the following into the Request body part of the Try this API form. Clicking on this prepopulated form automatically fills the request body, but you need to supply a valid project-id in each of the log names.

            "resourceNames": [
            "pageSize": 5,
            "filter": "logName : projects/project-id/logs/cloudaudit.googleapis.com"
  3. Click Execute.

For more details about queries, see Advanced logs queries.


The Cloud SDK has a group of commands, gcloud logging, that provide a command-line interface to the Cloud Logging API. To read your log entries, run the following command. Supply a valid project-id in each of the log names.

    gcloud logging read "logName : projects/project-id/logs/cloudaudit.googleapis.com"

See Reading log entries for more information about using the gcloud command-line tool.

For a sample audit log entry and how to find the most important information in it, go to Understanding audit logs.

To learn more about finding audit logs using the Logs Viewer, including tips about the query syntax, go to Viewing logs.