1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Logging
  5. getLogs
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Logging.getLogs

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

This data source provides the list of Logs in Oracle Cloud Infrastructure Logging service.

Lists the specified log group’s log objects.

Example Usage

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

const testLogs = oci.Logging.getLogs({
    logGroupId: testLogGroup.id,
    displayName: logDisplayName,
    logType: logLogType,
    sourceResource: logSourceResource,
    sourceService: logSourceService,
    state: logState,
});
Copy
import pulumi
import pulumi_oci as oci

test_logs = oci.Logging.get_logs(log_group_id=test_log_group["id"],
    display_name=log_display_name,
    log_type=log_log_type,
    source_resource=log_source_resource,
    source_service=log_source_service,
    state=log_state)
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.GetLogs(ctx, &logging.GetLogsArgs{
			LogGroupId:     testLogGroup.Id,
			DisplayName:    pulumi.StringRef(logDisplayName),
			LogType:        pulumi.StringRef(logLogType),
			SourceResource: pulumi.StringRef(logSourceResource),
			SourceService:  pulumi.StringRef(logSourceService),
			State:          pulumi.StringRef(logState),
		}, 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 testLogs = Oci.Logging.GetLogs.Invoke(new()
    {
        LogGroupId = testLogGroup.Id,
        DisplayName = logDisplayName,
        LogType = logLogType,
        SourceResource = logSourceResource,
        SourceService = logSourceService,
        State = logState,
    });

});
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.GetLogsArgs;
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 testLogs = LoggingFunctions.getLogs(GetLogsArgs.builder()
            .logGroupId(testLogGroup.id())
            .displayName(logDisplayName)
            .logType(logLogType)
            .sourceResource(logSourceResource)
            .sourceService(logSourceService)
            .state(logState)
            .build());

    }
}
Copy
variables:
  testLogs:
    fn::invoke:
      function: oci:Logging:getLogs
      arguments:
        logGroupId: ${testLogGroup.id}
        displayName: ${logDisplayName}
        logType: ${logLogType}
        sourceResource: ${logSourceResource}
        sourceService: ${logSourceService}
        state: ${logState}
Copy

Using getLogs

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 getLogs(args: GetLogsArgs, opts?: InvokeOptions): Promise<GetLogsResult>
function getLogsOutput(args: GetLogsOutputArgs, opts?: InvokeOptions): Output<GetLogsResult>
Copy
def get_logs(display_name: Optional[str] = None,
             filters: Optional[Sequence[_logging.GetLogsFilter]] = None,
             log_group_id: Optional[str] = None,
             log_type: Optional[str] = None,
             source_resource: Optional[str] = None,
             source_service: Optional[str] = None,
             state: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetLogsResult
def get_logs_output(display_name: Optional[pulumi.Input[str]] = None,
             filters: Optional[pulumi.Input[Sequence[pulumi.Input[_logging.GetLogsFilterArgs]]]] = None,
             log_group_id: Optional[pulumi.Input[str]] = None,
             log_type: Optional[pulumi.Input[str]] = None,
             source_resource: Optional[pulumi.Input[str]] = None,
             source_service: Optional[pulumi.Input[str]] = None,
             state: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetLogsResult]
Copy
func GetLogs(ctx *Context, args *GetLogsArgs, opts ...InvokeOption) (*GetLogsResult, error)
func GetLogsOutput(ctx *Context, args *GetLogsOutputArgs, opts ...InvokeOption) GetLogsResultOutput
Copy

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

public static class GetLogs 
{
    public static Task<GetLogsResult> InvokeAsync(GetLogsArgs args, InvokeOptions? opts = null)
    public static Output<GetLogsResult> Invoke(GetLogsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLogsResult> getLogs(GetLogsArgs args, InvokeOptions options)
public static Output<GetLogsResult> getLogs(GetLogsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Logging/getLogs:getLogs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

LogGroupId This property is required. string
OCID of a log group to work with.
DisplayName string
Resource name.
Filters Changes to this property will trigger replacement. List<GetLogsFilter>
LogType string
The logType that the log object is for, whether custom or service.
SourceResource string
Log object resource, which is a field of LogSummary.Configuration.Source.
SourceService string
Service that created the log object, which is a field of LogSummary.Configuration.Source.
State string
Lifecycle state of the log object
LogGroupId This property is required. string
OCID of a log group to work with.
DisplayName string
Resource name.
Filters Changes to this property will trigger replacement. []GetLogsFilter
LogType string
The logType that the log object is for, whether custom or service.
SourceResource string
Log object resource, which is a field of LogSummary.Configuration.Source.
SourceService string
Service that created the log object, which is a field of LogSummary.Configuration.Source.
State string
Lifecycle state of the log object
logGroupId This property is required. String
OCID of a log group to work with.
displayName String
Resource name.
filters Changes to this property will trigger replacement. List<GetLogsFilter>
logType String
The logType that the log object is for, whether custom or service.
sourceResource String
Log object resource, which is a field of LogSummary.Configuration.Source.
sourceService String
Service that created the log object, which is a field of LogSummary.Configuration.Source.
state String
Lifecycle state of the log object
logGroupId This property is required. string
OCID of a log group to work with.
displayName string
Resource name.
filters Changes to this property will trigger replacement. GetLogsFilter[]
logType string
The logType that the log object is for, whether custom or service.
sourceResource string
Log object resource, which is a field of LogSummary.Configuration.Source.
sourceService string
Service that created the log object, which is a field of LogSummary.Configuration.Source.
state string
Lifecycle state of the log object
log_group_id This property is required. str
OCID of a log group to work with.
display_name str
Resource name.
filters Changes to this property will trigger replacement. Sequence[logging.GetLogsFilter]
log_type str
The logType that the log object is for, whether custom or service.
source_resource str
Log object resource, which is a field of LogSummary.Configuration.Source.
source_service str
Service that created the log object, which is a field of LogSummary.Configuration.Source.
state str
Lifecycle state of the log object
logGroupId This property is required. String
OCID of a log group to work with.
displayName String
Resource name.
filters Changes to this property will trigger replacement. List<Property Map>
logType String
The logType that the log object is for, whether custom or service.
sourceResource String
Log object resource, which is a field of LogSummary.Configuration.Source.
sourceService String
Service that created the log object, which is a field of LogSummary.Configuration.Source.
state String
Lifecycle state of the log object

getLogs Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
LogGroupId string
Log group OCID.
Logs List<GetLogsLog>
The list of logs.
DisplayName string
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
Filters List<GetLogsFilter>
LogType string
The logType that the log object is for, whether custom or service.
SourceResource string
SourceService string
State string
The pipeline state.
Id string
The provider-assigned unique ID for this managed resource.
LogGroupId string
Log group OCID.
Logs []GetLogsLog
The list of logs.
DisplayName string
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
Filters []GetLogsFilter
LogType string
The logType that the log object is for, whether custom or service.
SourceResource string
SourceService string
State string
The pipeline state.
id String
The provider-assigned unique ID for this managed resource.
logGroupId String
Log group OCID.
logs List<GetLogsLog>
The list of logs.
displayName String
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
filters List<GetLogsFilter>
logType String
The logType that the log object is for, whether custom or service.
sourceResource String
sourceService String
state String
The pipeline state.
id string
The provider-assigned unique ID for this managed resource.
logGroupId string
Log group OCID.
logs GetLogsLog[]
The list of logs.
displayName string
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
filters GetLogsFilter[]
logType string
The logType that the log object is for, whether custom or service.
sourceResource string
sourceService string
state string
The pipeline state.
id str
The provider-assigned unique ID for this managed resource.
log_group_id str
Log group OCID.
logs Sequence[logging.GetLogsLog]
The list of logs.
display_name str
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
filters Sequence[logging.GetLogsFilter]
log_type str
The logType that the log object is for, whether custom or service.
source_resource str
source_service str
state str
The pipeline state.
id String
The provider-assigned unique ID for this managed resource.
logGroupId String
Log group OCID.
logs List<Property Map>
The list of logs.
displayName String
The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
filters List<Property Map>
logType String
The logType that the log object is for, whether custom or service.
sourceResource String
sourceService String
state String
The pipeline state.

Supporting Types

GetLogsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetLogsLog

CompartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
Configurations This property is required. List<GetLogsLogConfiguration>
Log object configuration.
DefinedTags This property is required. 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 This property is required. string
Resource name.
FreeformTags This property is required. 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 This property is required. string
The OCID of the resource.
IsEnabled This property is required. bool
Whether or not this resource is currently enabled.
LogGroupId This property is required. string
OCID of a log group to work with.
LogType This property is required. string
The logType that the log object is for, whether custom or service.
RetentionDuration This property is required. int
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
State This property is required. string
Lifecycle state of the log object
TenancyId This property is required. string
The OCID of the tenancy.
TimeCreated This property is required. string
Time the resource was created.
TimeLastModified This property is required. string
Time the resource was last modified.
CompartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
Configurations This property is required. []GetLogsLogConfiguration
Log object configuration.
DefinedTags This property is required. 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 This property is required. string
Resource name.
FreeformTags This property is required. 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 This property is required. string
The OCID of the resource.
IsEnabled This property is required. bool
Whether or not this resource is currently enabled.
LogGroupId This property is required. string
OCID of a log group to work with.
LogType This property is required. string
The logType that the log object is for, whether custom or service.
RetentionDuration This property is required. int
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
State This property is required. string
Lifecycle state of the log object
TenancyId This property is required. string
The OCID of the tenancy.
TimeCreated This property is required. string
Time the resource was created.
TimeLastModified This property is required. string
Time the resource was last modified.
compartmentId This property is required. String
The OCID of the compartment that the resource belongs to.
configurations This property is required. List<GetLogsLogConfiguration>
Log object configuration.
definedTags This property is required. 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 This property is required. String
Resource name.
freeformTags This property is required. 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 This property is required. String
The OCID of the resource.
isEnabled This property is required. Boolean
Whether or not this resource is currently enabled.
logGroupId This property is required. String
OCID of a log group to work with.
logType This property is required. String
The logType that the log object is for, whether custom or service.
retentionDuration This property is required. Integer
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state This property is required. String
Lifecycle state of the log object
tenancyId This property is required. String
The OCID of the tenancy.
timeCreated This property is required. String
Time the resource was created.
timeLastModified This property is required. String
Time the resource was last modified.
compartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
configurations This property is required. GetLogsLogConfiguration[]
Log object configuration.
definedTags This property is required. {[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 This property is required. string
Resource name.
freeformTags This property is required. {[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 This property is required. string
The OCID of the resource.
isEnabled This property is required. boolean
Whether or not this resource is currently enabled.
logGroupId This property is required. string
OCID of a log group to work with.
logType This property is required. string
The logType that the log object is for, whether custom or service.
retentionDuration This property is required. number
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state This property is required. string
Lifecycle state of the log object
tenancyId This property is required. string
The OCID of the tenancy.
timeCreated This property is required. string
Time the resource was created.
timeLastModified This property is required. string
Time the resource was last modified.
compartment_id This property is required. str
The OCID of the compartment that the resource belongs to.
configurations This property is required. Sequence[logging.GetLogsLogConfiguration]
Log object configuration.
defined_tags This property is required. 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 This property is required. str
Resource name.
freeform_tags This property is required. 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 This property is required. str
The OCID of the resource.
is_enabled This property is required. bool
Whether or not this resource is currently enabled.
log_group_id This property is required. str
OCID of a log group to work with.
log_type This property is required. str
The logType that the log object is for, whether custom or service.
retention_duration This property is required. int
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state This property is required. str
Lifecycle state of the log object
tenancy_id This property is required. str
The OCID of the tenancy.
time_created This property is required. str
Time the resource was created.
time_last_modified This property is required. str
Time the resource was last modified.
compartmentId This property is required. String
The OCID of the compartment that the resource belongs to.
configurations This property is required. List<Property Map>
Log object configuration.
definedTags This property is required. 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 This property is required. String
Resource name.
freeformTags This property is required. 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 This property is required. String
The OCID of the resource.
isEnabled This property is required. Boolean
Whether or not this resource is currently enabled.
logGroupId This property is required. String
OCID of a log group to work with.
logType This property is required. String
The logType that the log object is for, whether custom or service.
retentionDuration This property is required. Number
Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
state This property is required. String
Lifecycle state of the log object
tenancyId This property is required. String
The OCID of the tenancy.
timeCreated This property is required. String
Time the resource was created.
timeLastModified This property is required. String
Time the resource was last modified.

GetLogsLogConfiguration

CompartmentId This property is required. string
The OCID of the compartment that the resource belongs to.
Sources This property is required. List<GetLogsLogConfigurationSource>
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. []GetLogsLogConfigurationSource
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<GetLogsLogConfigurationSource>
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. GetLogsLogConfigurationSource[]
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.GetLogsLogConfigurationSource]
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.

GetLogsLogConfigurationSource

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.31.0 published on Thursday, Apr 17, 2025 by Pulumi