1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Logging
  5. getLogs
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.Logging.getLogs

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 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: oci_logging_log_group.test_log_group.id,
        displayName: _var.log_display_name,
        logType: _var.log_log_type,
        sourceResource: _var.log_source_resource,
        sourceService: _var.log_source_service,
        state: _var.log_state,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_logs = oci.Logging.get_logs(log_group_id=oci_logging_log_group["test_log_group"]["id"],
        display_name=var["log_display_name"],
        log_type=var["log_log_type"],
        source_resource=var["log_source_resource"],
        source_service=var["log_source_service"],
        state=var["log_state"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/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:     oci_logging_log_group.Test_log_group.Id,
    			DisplayName:    pulumi.StringRef(_var.Log_display_name),
    			LogType:        pulumi.StringRef(_var.Log_log_type),
    			SourceResource: pulumi.StringRef(_var.Log_source_resource),
    			SourceService:  pulumi.StringRef(_var.Log_source_service),
    			State:          pulumi.StringRef(_var.Log_state),
    		}, 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 = oci_logging_log_group.Test_log_group.Id,
            DisplayName = @var.Log_display_name,
            LogType = @var.Log_log_type,
            SourceResource = @var.Log_source_resource,
            SourceService = @var.Log_source_service,
            State = @var.Log_state,
        });
    
    });
    
    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(oci_logging_log_group.test_log_group().id())
                .displayName(var_.log_display_name())
                .logType(var_.log_log_type())
                .sourceResource(var_.log_source_resource())
                .sourceService(var_.log_source_service())
                .state(var_.log_state())
                .build());
    
        }
    }
    
    variables:
      testLogs:
        fn::invoke:
          Function: oci:Logging:getLogs
          Arguments:
            logGroupId: ${oci_logging_log_group.test_log_group.id}
            displayName: ${var.log_display_name}
            logType: ${var.log_log_type}
            sourceResource: ${var.log_source_resource}
            sourceService: ${var.log_source_service}
            state: ${var.log_state}
    

    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[_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]
    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Logging/getLogs:getLogs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    LogGroupId string
    OCID of a log group to work with.
    DisplayName string
    Resource name.
    Filters 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 string
    OCID of a log group to work with.
    DisplayName string
    Resource name.
    Filters []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 String
    OCID of a log group to work with.
    displayName String
    Resource name.
    filters 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 string
    OCID of a log group to work with.
    displayName string
    Resource name.
    filters 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 str
    OCID of a log group to work with.
    display_name str
    Resource name.
    filters 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 String
    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.
    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 string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetLogsLog

    CompartmentId string
    The OCID of the compartment that the resource belongs to.
    Configurations List<GetLogsLogConfiguration>
    Log object configuration.
    DefinedTags Dictionary<string, object>
    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.
    FreeformTags Dictionary<string, object>
    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
    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.
    TimeLastModified string
    Time the resource was last modified.
    CompartmentId string
    The OCID of the compartment that the resource belongs to.
    Configurations []GetLogsLogConfiguration
    Log object configuration.
    DefinedTags map[string]interface{}
    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.
    FreeformTags map[string]interface{}
    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
    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.
    TimeLastModified string
    Time the resource was last modified.
    compartmentId String
    The OCID of the compartment that the resource belongs to.
    configurations List<GetLogsLogConfiguration>
    Log object configuration.
    definedTags Map<String,Object>
    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.
    freeformTags Map<String,Object>
    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
    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.
    timeLastModified String
    Time the resource was last modified.
    compartmentId string
    The OCID of the compartment that the resource belongs to.
    configurations GetLogsLogConfiguration[]
    Log object configuration.
    definedTags {[key: string]: any}
    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.
    freeformTags {[key: string]: any}
    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
    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.
    timeLastModified string
    Time the resource was last modified.
    compartment_id str
    The OCID of the compartment that the resource belongs to.
    configurations Sequence[logging.GetLogsLogConfiguration]
    Log object configuration.
    defined_tags Mapping[str, Any]
    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.
    freeform_tags Mapping[str, Any]
    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
    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_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<Any>
    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.
    freeformTags Map<Any>
    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
    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.
    timeLastModified String
    Time the resource was last modified.

    GetLogsLogConfiguration

    CompartmentId string
    The OCID of the compartment that the resource belongs to.
    Sources List<GetLogsLogConfigurationSource>
    The source the log object comes from.
    CompartmentId string
    The OCID of the compartment that the resource belongs to.
    Sources []GetLogsLogConfigurationSource
    The source the log object comes from.
    compartmentId String
    The OCID of the compartment that the resource belongs to.
    sources List<GetLogsLogConfigurationSource>
    The source the log object comes from.
    compartmentId string
    The OCID of the compartment that the resource belongs to.
    sources GetLogsLogConfigurationSource[]
    The source the log object comes from.
    compartment_id str
    The OCID of the compartment that the resource belongs to.
    sources Sequence[logging.GetLogsLogConfigurationSource]
    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, object>
    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]interface{}
    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,Object>
    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]: any}
    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, Any]
    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<Any>
    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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi