Google GKE Audit Logs
Beta Feature
This input is currently in beta. If you run into any issues, please reach out to product@monad.com.
Ingests Kubernetes audit logs from Google Kubernetes Engine (GKE) clusters via Cloud Logging. This connector automatically filters and collects audit events from your GKE cluster's control plane.
Sync Type: Incremental
High volume: route through Pub/Sub
This connector reads directly from the Cloud Logging API: simple to set up, but reads are capped at 60,000 entries per minute per project with no Google-managed checkpoint, which GKE audit logging (especially Data Access) can exceed. For high-volume or no-loss collection, route logs through a Log Router sink into Pub/Sub and use the Pub/Sub input with the resource.type="k8s_cluster" filter.
Requirements
Before setting up the GKE Audit Logs input, you need to:
- Have a Google Cloud Platform (GCP) account with access to a GKE cluster.
- Have the GKE cluster with audit logging enabled:
- Admin Activity Logs (enabled by default)
- Data Access Logs (must be explicitly enabled if needed)
- Create a GCP service account with the necessary permissions.
- Generate a JSON key for the service account.
Enabling GKE Audit Logging
To ensure your GKE cluster is properly configured for audit log collection:
-
Verify Admin Activity Logs are enabled (default):
- Most GKE clusters have Admin Activity audit logging enabled by default
- This captures administrative actions like cluster creation, workload deployments, etc.
-
Enable Data Access Logs (if needed):
- Go to Google Cloud Console
- Navigate to "IAM & Admin" > "Audit Logs"
- Find the relevant services (e.g., Kubernetes Engine API)
- Enable "Data Access" logging if you need to audit read-only operations
Details
The GKE Audit Logs input wraps the Google Cloud Logs connector and automatically:
- Filters logs to your specific GKE cluster using the cluster name and location; this matches every
k8s_clusterlog name for the cluster, so non-audit logs such as Kubernetes events are ingested too - Enables proto payload parsing to properly decode Kubernetes audit log entries (AuditLog protobuf format)
- Tracks state using each entry's receive time (
receiveTimestamp) to implement incremental synchronization - Only fetches entries received after the last successful sync; on the first run it starts about 2 minutes behind the current time and does not read history (there is no backfill setting)
The connector translates your GKE configuration into a Cloud Logs filter that targets:
- Resource type:
k8s_cluster - Cluster name: your specified cluster name
- Location: your cluster's region or zone
Incremental Sync
Monad tracks each entry's receive time (receiveTimestamp) and only fetches newer entries on subsequent runs. To account for Cloud Logging's ingestion latency, reads trail the current time by about 2 minutes so late-arriving entries settle before they are read; records are therefore delivered roughly 2 minutes after Google ingests them.
Record format
Records use the Cloud Logs connector's encoding: snake_case keys, timestamp as {seconds, nanos}, numeric severity, and the decoded Kubernetes audit payload under Payload.ProtoPayload.value.
See the Cloud Logs sample record for the full shape.
Configuration
Settings
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
project_id | string | Yes | - | The GCP project ID that contains the GKE cluster. |
cluster_name | string | Yes | - | The name of the GKE cluster. Used to filter audit logs to this specific cluster. |
location | string | Yes | - | The GCP region or zone where the GKE cluster runs, e.g. us-central1 or us-central1-a. |
Secrets
| Secret | Type | Required | Description |
|---|---|---|---|
credentials_json | secret | No | JSON credentials to authenticate with Google Cloud (required for service account auth). |
Setting up the Service Account
- Go to the Google Cloud Console.
- Select your project from the project dropdown at the top of the page.
- Navigate to "IAM & Admin" > "Service Accounts".
- Click "Create Service Account".
- Enter a name for the service account (e.g., "gke-audit-logs") and click "Create".
- Assign the following role to the service account:
- Logs Viewer (
roles/logging.viewer) - If you enabled Data Access logs, also grant Private Logs Viewer (
roles/logging.privateLogViewer); without it Data Access entries are silently absent.
- Logs Viewer (
- Click "Continue" and then "Done".
- Find the newly created service account in the list and click on it.
- Go to the "Keys" tab and click "Add Key" > "Create new key".
- Choose JSON as the key type and click "Create".
- Save the downloaded JSON key file securely.
Setting up the Input
- In the Monad UI, go to the "Inputs" section.
- Click "Add Input" and select "GKE Audit Logs".
- Configure the input settings:
- Project ID: Your GCP project ID (e.g.,
my-gcp-project) - Cluster Name: The name of your GKE cluster (e.g.,
my-gke-cluster) - Location: The region or zone where your cluster runs (e.g.,
us-central1orus-central1-a)
- Project ID: Your GCP project ID (e.g.,
- In the "Secrets" section, paste the contents of your service account JSON key file.
- Test the connection to verify everything is configured correctly.
Rate Limits
This connector reads from the Cloud Logging API, which returns up to 60,000 log entries per minute per project; beyond that, entries can lag or be dropped. For high-volume collection, route logs through Pub/Sub instead (see the callout at the top of this page). See Cloud Logging quotas and limits for details.
Related Articles
- GKE Audit Logging Documentation
- Google Cloud Logging Documentation
- Logging Query Language
- Cloud Logging API Reference
- Kubernetes Audit Log Documentation
Sync frequency
By default this input polls approximately every 10 seconds, with each sync beginning after the previous one completes. A cron schedule configured on the pipeline overrides this cadence. See Input Sync Frequency for details.