steampipe plugin install oci

Table: oci_logging_log - Query OCI Logging Logs using SQL

Oracle Cloud Infrastructure's (OCI) Logging service is a highly scalable and fully managed single pane of glass for all the logs in your tenancy. The service helps you to manage and analyze logs from your resources in Oracle Cloud Infrastructure, your applications, and your on-premises resources. This makes it easier to monitor, troubleshoot, and react to operational and security issues.

Table Usage Guide

The oci_logging_log table provides insights into logs within Oracle Cloud Infrastructure's (OCI) Logging service. As a system administrator, this table is useful to explore log-specific details, including the log group it belongs to, the log type, and the configuration details. Utilize it to uncover information about logs, such as those with specific configurations, the relationships between logs and log groups, and the status of each log.

Examples

Basic info

Explore which logs have been created within your Oracle Cloud Infrastructure (OCI) environment, and assess their lifecycle state to understand if they are active or deleted. This can be useful for managing and tracking your OCI resources.

select
id,
log_group_id,
name,
lifecycle_state,
time_created
from
oci_logging_log;
select
id,
log_group_id,
name,
lifecycle_state,
time_created
from
oci_logging_log;

List inactive logs

Identify logs that are currently inactive. This can be useful in managing system resources or troubleshooting system issues by focusing on logs that are not actively recording data.

select
id,
name,
lifecycle_state as state,
time_created
from
oci_logging_log
where
lifecycle_state = 'INACTIVE';
select
id,
name,
lifecycle_state as state,
time_created
from
oci_logging_log
where
lifecycle_state = 'INACTIVE';

List VCN subnets with flow logging enabled

Assess the elements within your network by identifying active subnets that have flow logging enabled. This can help enhance network security and troubleshooting by providing visibility into traffic patterns and potential anomalies.

select
configuration -> 'source' ->> 'resource' as subnet_id,
configuration -> 'source' ->> 'service' as service,
lifecycle_state
from
oci_logging_log
where
configuration -> 'source' ->> 'service' = 'flowlogs'
and lifecycle_state = 'ACTIVE';
select
json_extract(configuration, '$.source.resource') as subnet_id,
json_extract(configuration, '$.source.service') as service,
lifecycle_state
from
oci_logging_log
where
json_extract(configuration, '$.source.service') = 'flowlogs'
and lifecycle_state = 'ACTIVE';

Schema for oci_logging_log

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
compartment_idtextThe OCID of the compartment in Tenant in which the resource is located.
configurationjsonbLog object configuration.
defined_tagsjsonbDefined 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.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
idtext=The OCID of the log.
is_enabledbooleanWhether or not this resource is currently enabled.
lifecycle_statetext=The log object state.
log_group_idtext=The OCID of the log group.
log_typetext=The logType that the log object is for, whether custom or service.
nametext=A user-friendly name.
regiontextThe OCI region in which the resource is located.
retention_durationbigintLog retention duration in 30-day increments (30, 60, 90 and so on).
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
tenant_idtext=, !=, ~~, ~~*, !~~, !~~*The OCID of the Tenant in which the resource is located.
tenant_nametextThe name of the Tenant in which the resource is located.
time_createdtimestamp with time zoneTime the resource was created.
time_last_modifiedtimestamp with time zoneTime the resource was last modified.
titletextTitle 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_logging_log