Cloud Logging Admin Source
The Cloud Logging Admin source enables tools to interact with the Cloud Logging API, allowing for the retrieval of log names, monitored resource types, and the querying of log data.
2 minute read
About
The Cloud Logging Admin source provides a client to interact with the Google Cloud Logging API. This allows tools to list log names, monitored resource types, and query log entries.
Authentication can be handled in two ways:
- Application Default Credentials (ADC): By default, the source uses ADC to authenticate with the API.
- Client-side OAuth: If
useClientOAuthis set totrue, the source will expect an OAuth 2.0 access token to be provided by the client (e.g., a web browser) for each request.
Available Tools
Cloud Logging Admin Source Tools
| Tool Name | Description |
|---|---|
| cloud-logging-admin-list-log-names Tool | A "cloud-logging-admin-list-log-names" tool lists the log names in the project. |
| cloud-logging-admin-list-resource-types Tool | A "cloud-logging-admin-list-resource-types" tool lists the monitored resource types. |
| cloud-logging-admin-query-logs Tool | A "cloud-logging-admin-query-logs" tool queries log entries. |
Example
Initialize a Cloud Logging Admin source that uses ADC:
kind: sources
name: my-cloud-logging
type: cloud-logging-admin
project: my-project-id
Initialize a Cloud Logging Admin source that uses client-side OAuth:
kind: sources
name: my-oauth-cloud-logging
type: cloud-logging-admin
project: my-project-id
useClientOAuth: true
Initialize a Cloud Logging Admin source that uses service account impersonation:
kind: sources
name: my-impersonated-cloud-logging
type: cloud-logging-admin
project: my-project-id
impersonateServiceAccount: "my-service-account@my-project.iam.gserviceaccount.com"
Reference
| field | type | required | description |
|---|---|---|---|
| type | string | true | Must be “cloud-logging-admin”. |
| project | string | true | ID of the GCP project. |
| useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to false. Cannot be used with impersonateServiceAccount. |
| impersonateServiceAccount | string | false | The service account to impersonate for API calls. Cannot be used with useClientOAuth. |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.