steampipe plugin install grafana

Table: grafana_user - Query Grafana Users using SQL

Grafana is a multi-platform open-source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources. Users in Grafana represent accounts with login credentials that can be granted permissions to access resources within Grafana.

Table Usage Guide

The grafana_user table provides insights into user accounts within Grafana. As an administrator or security analyst, explore user-specific details through this table, including their roles, permissions, and associated metadata. Utilize it to manage user access control, review user permissions, and ensure adherence to security policies.

Important Notes

  • The API used by this table requires admin user access via basic authentication (i.e. admin:password) in the auth config field. Reference.

Examples

List all users

Explore all the users within your Grafana platform to manage access and permissions effectively. This helps to maintain security and control over who can access and modify your data.

select
*
from
grafana_user;
select
*
from
grafana_user;

List all admin users

Identify instances where users have administrative privileges. This can be useful for ensuring proper access controls and identifying potential security risks.

select
login,
email,
is_admin
from
grafana_user
where
is_admin;
select
login,
email,
is_admin
from
grafana_user
where
is_admin = 1;

Users who have not been seen for more than 30 days

Discover the segments of users who have not logged in for over a month. This can be useful to identify inactive users and potentially reach out to them to re-engage them with the platform.

select
login,
email,
last_seen_at,
last_seen_at_age
from
grafana_user
where
last_seen_at < current_timestamp - interval '30 days';
select
login,
email,
last_seen_at,
last_seen_at_age
from
grafana_user
where
last_seen_at < datetime('now', '-30 days');

Users created in the last 7 days

Explore which Grafana users were created in the past week. This is useful to keep track of new user activity and growth within your system.

select
login,
email,
created_at
from
grafana_user
where
created_at > current_timestamp - interval '7 days';
select
login,
email,
created_at
from
grafana_user
where
created_at > datetime('now', '-7 days');

Schema for grafana_user

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
auth_labelsjsonbAuth labels for the user, e.g. OAuth.
avatar_urltextURL of the avatar for the user.
created_attimestamp with time zoneTime when the user was created.
emailtext=Email of the user.
idbigint=Unique identifier for the user.
is_adminbooleanTrue if the user is an administrator.
is_disabledbooleanTrue if the user has been disabled.
is_externalbooleanTrue if the user is external to the system.
last_seen_attimestamp with time zoneLast time the user logged in.
last_seen_at_agetextDisplay string for when the user last logged in, e.g. 2m.
logintextLogin name of the user.
nametextName of the user.
org_idbigintOrg the user is a member of.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
themetextUI theme preferred by the user.
updated_attimestamp with time zoneLast time the user was updated.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- grafana

You can pass the configuration to the command with the --config argument:

steampipe_export_grafana --config '<your_config>' grafana_user