PlanetScale Audit Logs

The PlanetScale source polls your organization’s audit logs every 60 seconds using a service token. Audit logs capture administrative actions such as database creation and deletion, branch operations, user access changes, and password management.

On the first poll RunReveal will ingest the most recent page of audit events (up to 200). Subsequent polls will continuously fetch any new events that have occurred since the last check.

Setup

Step 1: Create a PlanetScale Service Token

Service tokens are the recommended way to grant RunReveal API access without tying credentials to a specific user account.

  1. Sign in to your PlanetScale dashboard.
  2. Navigate to your organization settings.
  3. Select Service tokens from the left-hand navigation.
  4. Click New service token.
  5. Give the token a descriptive name such as RunReveal.
  6. After the token is created, copy both the Token ID and the Token secret — the secret is only shown once.
⚠️

Save the token secret immediately after creation. PlanetScale will not show it again.

Step 2: Grant the Required Permission

Once the token is created you need to grant it access to read audit logs.

  1. From the Service tokens page, find your newly created token and click on it.
  2. Under Organization permissions, click Add permission.
  3. Enable the audit_logs_read permission.
  4. Save your changes.

Step 3: Add the Source in RunReveal

  1. Navigate to Sources in RunReveal.
  2. Find the PlanetScale tile and click it.
  3. Fill in the following fields:
FieldDescription
Organization NameYour PlanetScale organization name (found in the URL: app.planetscale.com/<org-name>)
Service Token IDThe token ID copied from Step 1
Service Token SecretThe token secret copied from Step 1
  1. Click Create to save the source.

Verify It’s Working

Once added, logs should begin flowing within a minute. You can validate data is arriving by running:

SELECT * FROM runreveal.planetscale_logs LIMIT 10

Schema

The following columns are exposed for this source. RunReveal applies schema normalization across all sources, ensuring uniform field names and data types for cross-source queries and reusable detection logic.

Table: planetscale_logs (52 columns)

ColumnType
workspaceIDString
sourceIDString
sourceTypeString
sourceTTLUInt32
receivedAtDateTime
idString
eventTimeDateTime
eventNameString
eventIDString
srcIPString
srcASCountryCodeString
srcASNumberUInt32
srcASOrganizationString
srcCityString
srcConnectionTypeString
srcISPString
srcLatitudeFloat64
srcLongitudeFloat64
srcUserTypeString
dstIPString
dstASCountryCodeString
dstASNumberUInt32
dstASOrganizationString
dstCityString
dstConnectionTypeString
dstISPString
ColumnType
dstLatitudeFloat64
dstLongitudeFloat64
dstUserTypeString
actorMap(String, String)
tagsMap(String, String)
resourcesArray(String)
serviceNameString
enrichmentsArray(Tuple(data Map(String, String), name String, provider String, type String, value String))
readOnlyBool
rawLogString
psIdString
psAuditActionString
psActionString
psActorIdString
psActorTypeString
psActorDisplayNameString
psAuditableIdString
psAuditableTypeString
psAuditableDisplayNameString
psTargetIdString
psTargetTypeString
psTargetDisplayNameString
psLocationString
psRemoteIpString
psCreatedAtString
psUpdatedAtString
psMetadataString