Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Logging.getLogs
Explore with Pulumi AI
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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
variables:
  testLogs:
    fn::invoke:
      function: oci:Logging:getLogs
      arguments:
        logGroupId: ${testLogGroup.id}
        displayName: ${logDisplayName}
        logType: ${logLogType}
        sourceResource: ${logSourceResource}
        sourceService: ${logSourceService}
        state: ${logState}
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>def get_logs(display_name: Optional[str] = None,
             filters: Optional[Sequence[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[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]func GetLogs(ctx *Context, args *GetLogsArgs, opts ...InvokeOption) (*GetLogsResult, error)
func GetLogsOutput(ctx *Context, args *GetLogsOutputArgs, opts ...InvokeOption) GetLogsResultOutput> 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)
}public static CompletableFuture<GetLogsResult> getLogs(GetLogsArgs args, InvokeOptions options)
public static Output<GetLogsResult> getLogs(GetLogsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Logging/getLogs:getLogs
  arguments:
    # arguments dictionaryThe following arguments are supported:
- LogGroup stringId 
- OCID of a log group to work with.
- DisplayName string
- Resource name.
- Filters
List<GetLogs Filter> 
- 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
- LogGroup stringId 
- OCID of a log group to work with.
- DisplayName string
- Resource name.
- Filters
[]GetLogs Filter 
- 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
- logGroup StringId 
- OCID of a log group to work with.
- displayName String
- Resource name.
- filters
List<GetLogs Filter> 
- 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
- logGroup stringId 
- OCID of a log group to work with.
- displayName string
- Resource name.
- filters
GetLogs Filter[] 
- 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_ strid 
- OCID of a log group to work with.
- display_name str
- Resource name.
- filters
Sequence[GetLogs Filter] 
- 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
- logGroup StringId 
- OCID of a log group to work with.
- displayName String
- Resource name.
- filters 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.
- LogGroup stringId 
- Log group OCID.
- Logs
List<GetLogs Log> 
- 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<GetLogs Filter> 
- 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.
- LogGroup stringId 
- Log group OCID.
- Logs
[]GetLogs Log 
- 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
[]GetLogs Filter 
- 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.
- logGroup StringId 
- Log group OCID.
- logs
List<GetLogs Log> 
- 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<GetLogs Filter> 
- 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.
- logGroup stringId 
- Log group OCID.
- logs
GetLogs Log[] 
- 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
GetLogs Filter[] 
- 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_ strid 
- Log group OCID.
- logs
Sequence[GetLogs Log] 
- 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[GetLogs Filter] 
- 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.
- logGroup StringId 
- 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  
GetLogsLog  
- CompartmentId string
- The OCID of the compartment that the resource belongs to.
- Configurations
List<GetLogs Log Configuration> 
- Log object configuration.
- 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
- Resource name.
- 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.
- LogGroup stringId 
- OCID of a log group to work with.
- 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
- Lifecycle state of the log object
- TenancyId string
- The OCID of the tenancy.
- TimeCreated string
- Time the resource was created.
- TimeLast stringModified 
- Time the resource was last modified.
- CompartmentId string
- The OCID of the compartment that the resource belongs to.
- Configurations
[]GetLogs Log Configuration 
- Log object configuration.
- 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
- Resource name.
- 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.
- LogGroup stringId 
- OCID of a log group to work with.
- 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
- Lifecycle state of the log object
- TenancyId string
- The OCID of the tenancy.
- TimeCreated string
- Time the resource was created.
- TimeLast stringModified 
- Time the resource was last modified.
- compartmentId String
- The OCID of the compartment that the resource belongs to.
- configurations
List<GetLogs Log Configuration> 
- Log object configuration.
- 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
- Resource name.
- 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.
- logGroup StringId 
- OCID of a log group to work with.
- 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
- Lifecycle state of the log object
- tenancyId String
- The OCID of the tenancy.
- timeCreated String
- Time the resource was created.
- timeLast StringModified 
- Time the resource was last modified.
- compartmentId string
- The OCID of the compartment that the resource belongs to.
- configurations
GetLogs Log Configuration[] 
- Log object configuration.
- {[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
- Resource name.
- {[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.
- logGroup stringId 
- OCID of a log group to work with.
- 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
- Lifecycle state of the log object
- tenancyId string
- The OCID of the tenancy.
- timeCreated string
- Time the resource was created.
- timeLast stringModified 
- Time the resource was last modified.
- compartment_id str
- The OCID of the compartment that the resource belongs to.
- configurations
Sequence[GetLogs Log Configuration] 
- Log object configuration.
- 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
- Resource name.
- 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_ strid 
- OCID of a log group to work with.
- 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
- Lifecycle state of the log object
- tenancy_id str
- The OCID of the tenancy.
- time_created str
- Time the resource was created.
- time_last_ strmodified 
- 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.
- 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
- Resource name.
- 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.
- logGroup StringId 
- OCID of a log group to work with.
- 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
- Lifecycle state of the log object
- tenancyId String
- The OCID of the tenancy.
- timeCreated String
- Time the resource was created.
- timeLast StringModified 
- Time the resource was last modified.
GetLogsLogConfiguration   
- CompartmentId string
- The OCID of the compartment that the resource belongs to.
- Sources
List<GetLogs Log Configuration Source> 
- The source the log object comes from.
- CompartmentId string
- The OCID of the compartment that the resource belongs to.
- Sources
[]GetLogs Log Configuration Source 
- The source the log object comes from.
- compartmentId String
- The OCID of the compartment that the resource belongs to.
- sources
List<GetLogs Log Configuration Source> 
- The source the log object comes from.
- compartmentId string
- The OCID of the compartment that the resource belongs to.
- sources
GetLogs Log Configuration Source[] 
- The source the log object comes from.
- compartment_id str
- The OCID of the compartment that the resource belongs to.
- sources
Sequence[GetLogs Log Configuration Source] 
- The source the log object comes from.
- compartmentId String
- The OCID of the compartment that the resource belongs to.
- sources List<Property Map>
- The source the log object comes from.
GetLogsLogConfigurationSource    
- Category string
- Log object category.
- Parameters Dictionary<string, string>
- Log category parameters are stored here.
- Resource string
- The unique identifier of the resource emitting the log.
- Service string
- Service generating log.
- SourceType string
- The log source.- OCISERVICE: Oracle Service.
 
- Category string
- Log object category.
- Parameters map[string]string
- Log category parameters are stored here.
- Resource string
- The unique identifier of the resource emitting the log.
- Service string
- Service generating log.
- SourceType string
- The log source.- OCISERVICE: Oracle Service.
 
- category String
- Log object category.
- parameters Map<String,String>
- Log category parameters are stored here.
- resource String
- The unique identifier of the resource emitting the log.
- service String
- Service generating log.
- sourceType String
- The log source.- OCISERVICE: Oracle Service.
 
- category string
- Log object category.
- parameters {[key: string]: string}
- Log category parameters are stored here.
- resource string
- The unique identifier of the resource emitting the log.
- service string
- Service generating log.
- sourceType string
- The log source.- OCISERVICE: Oracle Service.
 
- category str
- Log object category.
- parameters Mapping[str, str]
- Log category parameters are stored here.
- resource str
- The unique identifier of the resource emitting the log.
- service str
- Service generating log.
- source_type str
- The log source.- OCISERVICE: Oracle Service.
 
- category String
- Log object category.
- parameters Map<String>
- Log category parameters are stored here.
- resource String
- The unique identifier of the resource emitting the log.
- service String
- Service generating log.
- sourceType 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 ociTerraform Provider.