Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 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[_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:
- Log
Group stringId - OCID of a log group to work with.
- Display
Name string - Resource name.
- Filters
List<Get
Logs Filter> - Log
Type string - The logType that the log object is for, whether custom or service.
- Source
Resource string - Log object resource, which is a field of LogSummary.Configuration.Source.
- Source
Service 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 stringId - OCID of a log group to work with.
- Display
Name string - Resource name.
- Filters
[]Get
Logs Filter - Log
Type string - The logType that the log object is for, whether custom or service.
- Source
Resource string - Log object resource, which is a field of LogSummary.Configuration.Source.
- Source
Service 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 StringId - OCID of a log group to work with.
- display
Name String - Resource name.
- filters
List<Get
Logs Filter> - log
Type String - The logType that the log object is for, whether custom or service.
- source
Resource String - Log object resource, which is a field of LogSummary.Configuration.Source.
- source
Service 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 stringId - OCID of a log group to work with.
- display
Name string - Resource name.
- filters
Get
Logs Filter[] - log
Type string - The logType that the log object is for, whether custom or service.
- source
Resource string - Log object resource, which is a field of LogSummary.Configuration.Source.
- source
Service 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[logging.
Get Logs 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
- log
Group StringId - OCID of a log group to work with.
- display
Name String - Resource name.
- filters List<Property Map>
- log
Type String - The logType that the log object is for, whether custom or service.
- source
Resource String - Log object resource, which is a field of LogSummary.Configuration.Source.
- source
Service 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.
- Log
Group stringId - Log group OCID.
- Logs
List<Get
Logs Log> - The list of logs.
- Display
Name string - The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- Filters
List<Get
Logs Filter> - Log
Type string - The logType that the log object is for, whether custom or service.
- Source
Resource string - Source
Service string - State string
- The pipeline state.
- Id string
- The provider-assigned unique ID for this managed resource.
- Log
Group stringId - Log group OCID.
- Logs
[]Get
Logs Log - The list of logs.
- Display
Name string - The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- Filters
[]Get
Logs Filter - Log
Type string - The logType that the log object is for, whether custom or service.
- Source
Resource string - Source
Service string - State string
- The pipeline state.
- id String
- The provider-assigned unique ID for this managed resource.
- log
Group StringId - Log group OCID.
- logs
List<Get
Logs Log> - The list of logs.
- display
Name String - The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- filters
List<Get
Logs Filter> - log
Type String - The logType that the log object is for, whether custom or service.
- source
Resource String - source
Service String - state String
- The pipeline state.
- id string
- The provider-assigned unique ID for this managed resource.
- log
Group stringId - Log group OCID.
- logs
Get
Logs Log[] - The list of logs.
- display
Name string - The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- filters
Get
Logs Filter[] - log
Type string - The logType that the log object is for, whether custom or service.
- source
Resource string - source
Service 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[logging.
Get Logs 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[logging.
Get Logs 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.
- log
Group StringId - Log group OCID.
- logs List<Property Map>
- The list of logs.
- display
Name 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>
- log
Type String - The logType that the log object is for, whether custom or service.
- source
Resource String - source
Service String - state String
- The pipeline state.
Supporting Types
GetLogsFilter
GetLogsLog
- Compartment
Id string - The OCID of the compartment that the resource belongs to.
- Configurations
List<Get
Logs 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"}
- Display
Name 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.
- Is
Enabled bool - Whether or not this resource is currently enabled.
- Log
Group stringId - OCID of a log group to work with.
- Log
Type string - 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 string
- Lifecycle state of the log object
- Tenancy
Id string - The OCID of the tenancy.
- Time
Created string - Time the resource was created.
- Time
Last stringModified - Time the resource was last modified.
- Compartment
Id string - The OCID of the compartment that the resource belongs to.
- Configurations
[]Get
Logs 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"}
- Display
Name 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.
- Is
Enabled bool - Whether or not this resource is currently enabled.
- Log
Group stringId - OCID of a log group to work with.
- Log
Type string - 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 string
- Lifecycle state of the log object
- Tenancy
Id string - The OCID of the tenancy.
- Time
Created string - Time the resource was created.
- Time
Last stringModified - Time the resource was last modified.
- compartment
Id String - The OCID of the compartment that the resource belongs to.
- configurations
List<Get
Logs 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"}
- display
Name 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.
- is
Enabled Boolean - Whether or not this resource is currently enabled.
- log
Group StringId - OCID of a log group to work with.
- log
Type String - The logType that the log object is for, whether custom or service.
- retention
Duration Integer - Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
- state String
- Lifecycle state of the log object
- tenancy
Id String - The OCID of the tenancy.
- time
Created String - Time the resource was created.
- time
Last StringModified - Time the resource was last modified.
- compartment
Id string - The OCID of the compartment that the resource belongs to.
- configurations
Get
Logs 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"}
- display
Name 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.
- is
Enabled boolean - Whether or not this resource is currently enabled.
- log
Group stringId - OCID of a log group to work with.
- log
Type string - The logType that the log object is for, whether custom or service.
- retention
Duration number - Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
- state string
- Lifecycle state of the log object
- tenancy
Id string - The OCID of the tenancy.
- time
Created string - Time the resource was created.
- time
Last stringModified - Time the resource was last modified.
- compartment_
id str - The OCID of the compartment that the resource belongs to.
- configurations
Sequence[logging.
Get Logs 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.
- compartment
Id 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"}
- display
Name 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.
- is
Enabled Boolean - Whether or not this resource is currently enabled.
- log
Group StringId - OCID of a log group to work with.
- log
Type String - The logType that the log object is for, whether custom or service.
- retention
Duration Number - Log retention duration in 30-day increments (30, 60, 90 and so on until 180).
- state String
- Lifecycle state of the log object
- tenancy
Id String - The OCID of the tenancy.
- time
Created String - Time the resource was created.
- time
Last StringModified - Time the resource was last modified.
GetLogsLogConfiguration
- Compartment
Id string - The OCID of the compartment that the resource belongs to.
- Sources
List<Get
Logs Log Configuration Source> - The source the log object comes from.
- Compartment
Id string - The OCID of the compartment that the resource belongs to.
- Sources
[]Get
Logs Log Configuration Source - The source the log object comes from.
- compartment
Id String - The OCID of the compartment that the resource belongs to.
- sources
List<Get
Logs Log Configuration Source> - The source the log object comes from.
- compartment
Id string - The OCID of the compartment that the resource belongs to.
- sources
Get
Logs 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[logging.
Get Logs Log Configuration Source] - The source the log object comes from.
- compartment
Id 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.
- Source
Type 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.
- Source
Type 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.
- source
Type 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.
- source
Type 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.
- source
Type 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.