Table: oci_events_rule - Query OCI Events Rules using SQL
Oracle Cloud Infrastructure's (OCI) Events service is a cloud-native event routing platform that enables you to automate your application architecture by responding to state changes. Using simple rules, you can match events and route them to one or more targets to take action. A rule is a set of actions that Events service takes when an event that matches a condition occurs.
Table Usage Guide
The oci_events_rule
table provides insights into the rules within OCI Events service. As a DevOps engineer, you can explore rule-specific details through this table, including conditions, actions, and associated metadata. Utilize it to uncover information about rules, such as those with specific conditions, the actions taken when those conditions are met, and the verification of those actions.
Examples
Basic info
Explore the status and conditions of events rules in Oracle Cloud Infrastructure (OCI) to understand their functionality and lifecycle. This can help in monitoring rule performance, identifying enabled rules, and assessing the actions taken when rules are triggered.
select id as rule_id, display_name, lifecycle_state as state, condition, is_enabled, time_created, actionsfrom oci_events_rule;
select id as rule_id, display_name, lifecycle_state as state, condition, is_enabled, time_created, actionsfrom oci_events_rule;
List enabled rules
Explore which rules are currently active in your system. This can help you understand which conditions are being monitored, assisting in system maintenance and troubleshooting.
select id as rule_id, display_name, lifecycle_state, condition, is_enabledfrom oci_events_rulewhere is_enabled;
select id as rule_id, display_name, lifecycle_state, condition, is_enabledfrom oci_events_rulewhere is_enabled;
List failed rules
Discover the segments that have rules in a 'FAILED' state in your Oracle Cloud Infrastructure's Events service. This can help pinpoint specific areas needing attention, promoting efficient troubleshooting and system optimization.
select id as rule_id, display_name, lifecycle_state, condition, is_enabledfrom oci_events_rulewhere lifecycle_state = 'FAILED';
select id as rule_id, display_name, lifecycle_state, condition, is_enabledfrom oci_events_rulewhere lifecycle_state = 'FAILED';
Get action details for rules that have the Oracle Notification Service action type
Determine the specifics of rules that utilize the Oracle Notification Service. This query is useful for identifying and managing these particular rules, offering insights into their status, associated topics, and overall configuration.
select id as rule_id, display_name, is_enabled, a ->> 'actionType' as action_type, a ->> 'id' as action_id, a ->> 'isEnabled' as action_is_enabled, a ->> 'lifecycleState' as action_state, a ->> 'topicId' as topic_idfrom oci_events_rule, jsonb_array_elements(actions) as awhere a ->> 'actionType' = 'ONS'
select rule.id as rule_id, display_name, is_enabled, json_extract(a.value, '$.actionType') as action_type, json_extract(a.value, '$.id') as action_id, json_extract(a.value, '$.isEnabled') as action_is_enabled, json_extract(a.value, '$.lifecycleState') as action_state, json_extract(a.value, '$.topicId') as topic_idfrom oci_events_rule rule, json_each(actions) as awhere json_extract(a.value, '$.actionType') = 'ONS'
Get action details for rules that have the Oracle Streaming Service action type
Explore the details of specific rules in Oracle Streaming Service, focusing on their current state and whether they are enabled. This can be useful for managing and monitoring the status of various rules within your streaming service.
select id as rule_id, display_name, is_enabled, a ->> 'actionType' as action_type, a ->> 'id' as action_id, a ->> 'isEnabled' as action_is_enabled, a ->> 'lifecycleState' as action_state, a ->> 'streamId' as stream_idfrom oci_events_rule, jsonb_array_elements(actions) as awhere a ->> 'actionType' = 'OSS'
select rule_id, display_name, is_enabled, json_extract(a.value, '$.actionType') as action_type, json_extract(a.value, '$.id') as action_id, json_extract(a.value, '$.isEnabled') as action_is_enabled, json_extract(a.value, '$.lifecycleState') as action_state, json_extract(a.value, '$.streamId') as stream_idfrom oci_events_rule, json_each(actions) as awhere json_extract(a.value, '$.actionType') = 'OSS'
Get event type details for each rule
Explore which rules are associated with specific event types in your Oracle Cloud Infrastructure events setup. This can help in managing and understanding the functioning of different rules in your system.
select id as rule_id, display_name, condition ->> 'eventType' as event_typefrom oci_events_rule;
select id as rule_id, display_name, json_extract(condition, '$.eventType') as event_typefrom oci_events_rule;
Control examples
- CIS v1.1.0 > 3 Logging and Monitoring > 3.10 Ensure a notification is configured for changes to route tables
- CIS v1.1.0 > 3 Logging and Monitoring > 3.11 Ensure a notification is configured for security list changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.12 Ensure a notification is configured for network security group changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.13 Ensure a notification is configured for changes to network gateways
- CIS v1.1.0 > 3 Logging and Monitoring > 3.4 Ensure a notification is configured for Identity Provider changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.5 Ensure a notification is configured for IdP group mapping changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.6 Ensure a notification is configured for IAM group changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.7 Ensure a notification is configured for IAM policy changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.8 Ensure a notification is configured for user changes
- CIS v1.1.0 > 3 Logging and Monitoring > 3.9 Ensure a notification is configured for VCN changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.10 Ensure a notification is configured for changes to route tables
- CIS v1.2.0 > 3 Logging and Monitoring > 3.11 Ensure a notification is configured for security list changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.12 Ensure a notification is configured for network security group changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.13 Ensure a notification is configured for changes to network gateways
- CIS v1.2.0 > 3 Logging and Monitoring > 3.4 Ensure a notification is configured for Identity Provider changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.5 Ensure a notification is configured for IdP group mapping changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.6 Ensure a notification is configured for IAM group changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.7 Ensure a notification is configured for IAM policy changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.8 Ensure a notification is configured for user changes
- CIS v1.2.0 > 3 Logging and Monitoring > 3.9 Ensure a notification is configured for VCN changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.10 Ensure a notification is configured for security list changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.11 Ensure a notification is configured for network security group changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.12 Ensure a notification is configured for changes to network gateways
- CIS v2.0.0 > 4 Logging and Monitoring > 4.15 Ensure a notification is configured for Oracle Cloud Guard problems detected
- CIS v2.0.0 > 4 Logging and Monitoring > 4.3 Ensure a notification is configured for Identity Provider changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.4 Ensure a notification is configured for IdP group mapping changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.5 Ensure a notification is configured for IAM group changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.6 Ensure a notification is configured for IAM policy changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.7 Ensure a notification is configured for user changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.8 Ensure a notification is configured for VCN changes
- CIS v2.0.0 > 4 Logging and Monitoring > 4.9 Ensure a notification is configured for changes to route tables
Schema for oci_events_rule
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
actions | jsonb | An object that represents an action to trigger for events that match a rule. | |
compartment_id | text | = | ColumnDescriptionCompartment |
condition | jsonb | A filter that specifies the event that will trigger actions associated with this rule. | |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. | |
description | text | A string that describes the details of the rule. | |
display_name | text | = | A string that describes the rule. |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The OCID of this rule. |
is_enabled | boolean | Indicates whether or not this rule is currently enabled. | |
lifecycle_message | text | A message generated by the Events service about the current state of this rule. | |
lifecycle_state | text | = | The current state of the rule. |
region | text | The OCI region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
time_created | timestamp with time zone | The time this rule was created. | |
title | text | Title of the resource. |
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)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_events_rule