turbot/steampipecloud
steampipe plugin install steampipecloud

Table: steampipecloud_workspace_db_log

Database logs records the underlying queries executed when a user executes a query.

Examples

List db logs for an actor by handle

select
id,
workspace_id,
workspace_handle,
duration,
query,
log_timestamp
from
steampipecloud_workspace_db_log
where
actor_handle = 'siddharthaturbot';

List db logs for an actor by handle in a particular workspace

select
id,
workspace_id,
workspace_handle,
duration,
query,
log_timestamp
from
steampipecloud_workspace_db_log
where
actor_handle = 'siddharthaturbot'
and workspace_handle = 'dev';

List queries that took more than 30 seconds to execute

select
id,
workspace_id,
workspace_handle,
duration,
query,
log_timestamp
from
steampipecloud_workspace_db_log
where
duration > 30000;

List all queries that ran in my workspace in the last hour

select
id,
workspace_id,
workspace_handle,
duration,
query,
log_timestamp
from
steampipecloud_workspace_db_log
where
workspace_handle = 'dev'
and log_timestamp > now() - interval '1 hr';

Schema for steampipecloud_workspace_db_log

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
actor_avatar_urltextThe avatar of the user who executed the query.
actor_display_nametextThe display name of the user who executed the query.
actor_handletextThe handle of the user who executed the query.
actor_idtextThe unique identifier for the user who executed the query.
created_attextThe time when the db log record was generated.
durationdouble precisionThe duration of the query in milliseconds(ms).
idtextThe unique identifier for a db log.
log_timestamptimestamp with time zoneThe time when the log got captured in postgres.
querytextThe query that was executed in the workspace.
workspace_handletextThe handle of the workspace on which the query was executed.
workspace_idtextThe unique identifier of the workspace on which the query was executed.