Skip to content

PlanetScale CLI commands - audit log

Use the PlanetScale CLI to create development branches, open deploy requests, and make non-blocking schema changes directly from your terminal.

Getting Started

Make sure to first set up your PlanetScale developer environment. Once you've installed the pscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.

The audit log command

Lists all audit logs in an organization. The user running the command must have Organization-level permissions, specifically list_organization_audit_logs.

Usage:

Copied
pscale audit-log <SUB-COMMAND> <FLAG>

Available sub-commands

Sub-commandDescription
listList all audit logs in an organization

Available flags

FlagDescription
-h, --helpView help for audit-log command
--org <ORGANIZATION_NAME>The organization for the current user

Global flags

CommandDescription
--api-token <TOKEN>The API token to use for authenticating against the PlanetScale API.
--api-url <URL>The base URL for the PlanetScale API. Default is https://api.planetscale.com/.
--config <CONFIG_FILE>Config file. Default is $HOME/.config/planetscale/pscale.yml.
--debugEnable debug mode.
-f, --format <FORMAT>Show output in a specific format. Possible values: human (default), json, csv.
--no-colorDisable color output.
--service-token <TOKEN>The service token for authenticating.
--service-token-id <TOKEN_ID>The service token ID for authenticating.

Examples

The list sub-command with --org flag

Command:

Copied
pscale audit-log list --org <ORGANIZATION_NAME>

Output:

Copied
ACTOR (25) ACTION EVENT REMOTE IP LOCATION CREATED AT
----------- ------------------------ ------------------------ --------------- ---------------- ------------
Name Open_web_console main branch.open_web_console xxx.xxx.xxx.x Los Angeles, CA 1 day ago

Need help?

Get help from PlanetScale's support team, or join our GitHub Discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on May 3, 2022
Help us improve this page
PrivacyTerms© 2022 PlanetScale Inc.