turbot/pagerduty
steampipe plugin install pagerduty

Table: pagerduty_ruleset - Query PagerDuty Rulesets using SQL

A PagerDuty Ruleset is a collection of rules that determine what actions to take when an event is triggered. Rulesets help to control the routing, suppression, and grouping of incidents. They are a crucial component in managing the incident response process in PagerDuty.

Table Usage Guide

The pagerduty_ruleset table provides insights into the rulesets within PagerDuty's incident management system. As an incident response manager or system administrator, explore ruleset-specific details through this table, including the rules defined, their conditions, and actions. Utilize it to manage and optimize the incident response process, such as routing incidents to appropriate responders, suppressing non-critical incidents, and grouping related incidents together.

Examples

Basic info

Explore the different rulesets in your PagerDuty account to understand their types and identifiers. This can help in managing and organizing your incident response workflows effectively.

select
name,
id,
type
from
pagerduty_ruleset;
select
name,
id,
type
from
pagerduty_ruleset;

List default global rulesets

Explore which rulesets are set as the default global rules within your PagerDuty configuration. This is useful for understanding the overarching rules that apply to all incidents, allowing for better incident management and response.

select
name,
id,
type
from
pagerduty_ruleset
where
type = 'default_global';
select
name,
id,
type
from
pagerduty_ruleset
where
type = 'default_global';

List rulesets not owned by any team

Explore which rulesets in your PagerDuty configuration aren't associated with any team. This can help identify potential gaps in your incident management workflows.

select
name,
id,
type
from
pagerduty_ruleset
where
team is null;
select
name,
id,
type
from
pagerduty_ruleset
where
team is null;

Count event rules per ruleset

Analyze the settings to understand the distribution of event rules across different rulesets. This can help you optimize event management by identifying rulesets with an excessive or insufficient number of rules.

select
rs.id as ruleset_id,
count(r.id)
from
pagerduty_ruleset as rs
left join pagerduty_ruleset_rule as r on rs.id = r.ruleset_id
group by
rs.id;
select
rs.id as ruleset_id,
count(r.id)
from
pagerduty_ruleset as rs
left join pagerduty_ruleset_rule as r on rs.id = r.ruleset_id
group by
rs.id;

Schema for pagerduty_ruleset

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
creatorjsonbA set of information about the user who created the ruleset.
idtext=An unique identifier of a ruleset.
nametextThe name of the ruleset.
routing_keysjsonbA list of routing keys for this ruleset.
teamjsonbA set of information about the team that owns the ruleset.
titletextTitle of the resource.
typetextThe type of the ruleset. Allowed values are: 'global' and 'default_global'.
updaterjsonbA set information about the user that has updated the ruleset.

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)" -- pagerduty

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

steampipe_export_pagerduty --config '<your_config>' pagerduty_ruleset