1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Logging
  5. getLog
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.Logging.getLog

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

This data source provides details about a specific Log resource in Oracle Cloud Infrastructure Logging service.

Gets the log object configuration for the log object OCID.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testLog = oci.Logging.getLog({
    logGroupId: testLogGroup.id,
    logId: testLogOciLoggingLog.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_log = oci.Logging.get_log(log_group_id=test_log_group["id"],
    log_id=test_log_oci_logging_log["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/logging"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := logging.GetLog(ctx, &logging.GetLogArgs{
			LogGroupId: testLogGroup.Id,
			LogId:      testLogOciLoggingLog.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testLog = Oci.Logging.GetLog.Invoke(new()
    {
        LogGroupId = testLogGroup.Id,
        LogId = testLogOciLoggingLog.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Logging.LoggingFunctions;
import com.pulumi.oci.Logging.inputs.GetLogArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testLog = LoggingFunctions.getLog(GetLogArgs.builder()
            .logGroupId(testLogGroup.id())
            .logId(testLogOciLoggingLog.id())
            .build());

    }
}
Copy
variables:
  testLog:
    fn::invoke:
      function: oci:Logging:getLog
      arguments:
        logGroupId: ${testLogGroup.id}
        logId: ${testLogOciLoggingLog.id}
Copy

Using getLog

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getLog(args: GetLogArgs, opts?: InvokeOptions): Promise<GetLogResult>
function getLogOutput(args: GetLogOutputArgs, opts?: InvokeOptions): Output<GetLogResult>
Copy
def get_log(log_group_id: Optional[str] = None,
            log_id: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetLogResult
def get_log_output(log_group_id: Optional[pulumi.Input[str]] = None,
            log_id: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetLogResult]
Copy
func GetLog(ctx *Context, args *GetLogArgs, opts ...InvokeOption) (*GetLogResult, error)
func GetLogOutput(ctx *Context, args *GetLogOutputArgs, opts ...InvokeOption) GetLogResultOutput
Copy

> Note: This function is named GetLog in the Go SDK.

public static class GetLog 
{
    public static Task<GetLogResult> InvokeAsync(GetLogArgs args, InvokeOptions? opts = null)
    public static Output<GetLogResult> Invoke(GetLogInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLogResult> getLog(GetLogArgs args, InvokeOptions options)
public static Output<GetLogResult> getLog(GetLogArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Logging/getLog:getLog
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

LogGroupId This property is required. string
OCID of a log group to work with.
LogId This property is required. string
OCID of a log to work with.
LogGroupId This property is required. string
OCID of a log group to work with.
LogId This property is required. string
OCID of a log to work with.
logGroupId This property is required. String
OCID of a log group to work with.
logId This property is required. String
OCID of a log to work with.
logGroupId This property is required. string
OCID of a log group to work with.
logId This property is required. string
OCID of a log to work with.
log_group_id This property is required. str
OCID of a log group to work with.
log_id This property is required. str
OCID of a log to work with.
logGroupId This property is required. String
OCID of a log group to work with.
logId This property is required. String
OCID of a log to work with.

getLog Result

The following output properties are available:

CompartmentId string
The OCID of the compartment that the resource belongs to.
Configurations List<GetLogConfiguration>
Log object configuration.
DefinedTags Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id string
The OCID of the resource.
IsEnabled bool
Whether or not this resource is currently enabled.
LogGroupId string
Log group OCID.
LogId string
LogType string
The logType that the log object is for, whether custom or service.
RetentionDuration int
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
State string
The pipeline state.
TenancyId string
The OCID of the tenancy.
TimeCreated string
Time the resource was created.
TimeLastModified string
Time the resource was last modified.
CompartmentId string
The OCID of the compartment that the resource belongs to.
Configurations []GetLogConfiguration
Log object configuration.
DefinedTags map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
FreeformTags map[string]string
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id string
The OCID of the resource.
IsEnabled bool
Whether or not this resource is currently enabled.
LogGroupId string
Log group OCID.
LogId string
LogType string
The logType that the log object is for, whether custom or service.
RetentionDuration int
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
State string
The pipeline state.
TenancyId string
The OCID of the tenancy.
TimeCreated string
Time the resource was created.
TimeLastModified string
Time the resource was last modified.
compartmentId String
The OCID of the compartment that the resource belongs to.
configurations List<GetLogConfiguration>
Log object configuration.
definedTags Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
freeformTags Map<String,String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id String
The OCID of the resource.
isEnabled Boolean
Whether or not this resource is currently enabled.
logGroupId String
Log group OCID.
logId String
logType String
The logType that the log object is for, whether custom or service.
retentionDuration Integer
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state String
The pipeline state.
tenancyId String
The OCID of the tenancy.
timeCreated String
Time the resource was created.
timeLastModified String
Time the resource was last modified.
compartmentId string
The OCID of the compartment that the resource belongs to.
configurations GetLogConfiguration[]
Log object configuration.
definedTags {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName string
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
freeformTags {[key: string]: string}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id string
The OCID of the resource.
isEnabled boolean
Whether or not this resource is currently enabled.
logGroupId string
Log group OCID.
logId string
logType string
The logType that the log object is for, whether custom or service.
retentionDuration number
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state string
The pipeline state.
tenancyId string
The OCID of the tenancy.
timeCreated string
Time the resource was created.
timeLastModified string
Time the resource was last modified.
compartment_id str
The OCID of the compartment that the resource belongs to.
configurations Sequence[logging.GetLogConfiguration]
Log object configuration.
defined_tags Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
display_name str
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
freeform_tags Mapping[str, str]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id str
The OCID of the resource.
is_enabled bool
Whether or not this resource is currently enabled.
log_group_id str
Log group OCID.
log_id str
log_type str
The logType that the log object is for, whether custom or service.
retention_duration int
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state str
The pipeline state.
tenancy_id str
The OCID of the tenancy.
time_created str
Time the resource was created.
time_last_modified str
Time the resource was last modified.
compartmentId String
The OCID of the compartment that the resource belongs to.
configurations List<Property Map>
Log object configuration.
definedTags Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
freeformTags Map<String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id String
The OCID of the resource.
isEnabled Boolean
Whether or not this resource is currently enabled.
logGroupId String
Log group OCID.
logId String
logType String
The logType that the log object is for, whether custom or service.
retentionDuration Number
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state String
The pipeline state.
tenancyId String
The OCID of the tenancy.
timeCreated String
Time the resource was created.
timeLastModified String
Time the resource was last modified.

Supporting Types

GetLogConfiguration

CompartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
Sources This property is required. List<GetLogConfigurationSource>
The source the log object comes from.
CompartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
Sources This property is required. []GetLogConfigurationSource
The source the log object comes from.
compartmentId This property is required. String
The OCID of the compartment that the resource belongs to.
sources This property is required. List<GetLogConfigurationSource>
The source the log object comes from.
compartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
sources This property is required. GetLogConfigurationSource[]
The source the log object comes from.
compartment_id This property is required. str
The OCID of the compartment that the resource belongs to.
sources This property is required. Sequence[logging.GetLogConfigurationSource]
The source the log object comes from.
compartmentId This property is required. String
The OCID of the compartment that the resource belongs to.
sources This property is required. List<Property Map>
The source the log object comes from.

GetLogConfigurationSource

Category This property is required. string
Log object category.
Parameters This property is required. Dictionary<string, string>
Log category parameters are stored here.
Resource This property is required. string
The unique identifier of the resource emitting the log.
Service This property is required. string
Service generating log.
SourceType This property is required. string
The log source.

  • OCISERVICE: Oracle Service.
Category This property is required. string
Log object category.
Parameters This property is required. map[string]string
Log category parameters are stored here.
Resource This property is required. string
The unique identifier of the resource emitting the log.
Service This property is required. string
Service generating log.
SourceType This property is required. string
The log source.

  • OCISERVICE: Oracle Service.
category This property is required. String
Log object category.
parameters This property is required. Map<String,String>
Log category parameters are stored here.
resource This property is required. String
The unique identifier of the resource emitting the log.
service This property is required. String
Service generating log.
sourceType This property is required. String
The log source.

  • OCISERVICE: Oracle Service.
category This property is required. string
Log object category.
parameters This property is required. {[key: string]: string}
Log category parameters are stored here.
resource This property is required. string
The unique identifier of the resource emitting the log.
service This property is required. string
Service generating log.
sourceType This property is required. string
The log source.

  • OCISERVICE: Oracle Service.
category This property is required. str
Log object category.
parameters This property is required. Mapping[str, str]
Log category parameters are stored here.
resource This property is required. str
The unique identifier of the resource emitting the log.
service This property is required. str
Service generating log.
source_type This property is required. str
The log source.

  • OCISERVICE: Oracle Service.
category This property is required. String
Log object category.
parameters This property is required. Map<String>
Log category parameters are stored here.
resource This property is required. String
The unique identifier of the resource emitting the log.
service This property is required. String
Service generating log.
sourceType This property is required. String
The log source.

  • OCISERVICE: Oracle Service.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi