Cloud Logging 欄位定義

啟用 Cloud 稽核記錄後, Google Cloud 控制台記錄檔探索工具會記錄下列類別的內容:

  • AuditLog protobuf
  • API 層級記錄

啟用及查看

您可以透過 Cloud 稽核記錄查看 Google Cloud 資源中的管理活動和權限。

啟用記錄功能

請按照下列步驟啟用記錄。

  1. 前往 Google Cloud 控制台,依序選取「IAM 與管理」>「稽核記錄」
  2. 輸入「資料存取稽核記錄設定」Dialogflow API 篩選器,然後選取下列 API 類型:「管理員讀取」、「資料讀取」和「資料寫入」

查看記錄

您必須取得專案擁有者私密記錄檢視者 IAM 角色,然後按照下列步驟查看記錄。

  1. 前往 Google Cloud 控制台,然後依序選取「Logging」(記錄) >「Logs Explorer」(記錄檔探索工具)
  2. 選用步驟:在 Logs Explorer 中新增篩選器,或依喜好調整時間軸。
  3. 選取項目即可查看詳細資料。

記錄 proto

每個記錄項目都會是 AuditLog proto 的例項,其中包含下列欄位:

欄位類型 欄位名稱
字串 service_name
字串 method_name
字串 資源名稱
ResourceLocation resource_location
  • current_locations
  • original_locations
google.protobuf.Struct resource_original_state
int64 num_response_items
google.rpc.Status 狀態
AuthenticationInfo authentication_info
  • principal_email
  • 主體
  • authority_selector
  • third_party_principal
  • service_account_key_name
  • service_account_delegation_info
  • service_account_delegation_session_id
  • principal_subject
  • service_delegation_history
重複的 AuthorizationInfo authorization_info
  • authorization_logging_options
  • resource_attributes
  • admin_access_control_authorization_info
  • permission_type
    • ADMIN_READ
    • ADMIN_WRITE
    • DATA_READ
    • DATA_WRITE
  • impersonation_peer_borg_role
PolicyViolationInfo policy_violation_info
重複的 PolicyViolationInfo policy_violations
RequestMetadata request_metadata
  • caller_ip
  • caller_supplied_user_agent
  • caller_network
  • caller_location
  • caller_region_code
  • caller_internal_gce_vnid
  • caller_gce_network_project_number
  • caller_is_gce_client
  • request_attributes
  • destination_attributes
google.protobuf.Struct 要求
google.protobuf.Struct 回應
google.protobuf.Struct 中繼資料
位元組 audit_loggable_mint
位元組 loggable_ubermint
位元組 audit_loggable_service_control_token
遮蓋 redactions
  • 類型
    • 已清除
    • REPLACED
    • FAILED_TO_PROVIDE
    • NOT_REQUIRED
    • PARTIAL
  • 欄位
  • 原因

根據啟用的 Cloud 稽核記錄欄位,記錄探索器會將 API 的要求和回應主體填入記錄原型的要求和回應欄位。

API 層級記錄的欄位

API 記錄欄位
AnalyzeContent 請求
  • 參與者
StreamingAnalyzeContent 請求
  • 參與者
回應
  • speech_model
CreateConversation 請求
  • parent
  • 對話
    • conversation_profile
回應
  • conversation_profile
  • lifecycle_state
  • 名稱
  • start_time
CreateParticipant 請求
  • parent
  • 參與者
    • 角色
回應
  • 名稱
  • 角色
SuggestConversationSummary 請求
  • 對話
回應
  • latest_message
  • answer_record
SearchKnowledge 請求
  • parent
  • conversation_profile
  • 對話
  • latest_message
回應
  • answer_record
SuggestKnowledgeAssist 請求
  • parent
  • latest_message
回應
  • latest_message
  • answer_record