1. Packages
  2. Datadog
  3. API Docs
  4. LogsIndex
Datadog v4.23.0 published on Wednesday, Sep 27, 2023 by Pulumi

datadog.LogsIndex

Explore with Pulumi AI

datadog logo
Datadog v4.23.0 published on Wednesday, Sep 27, 2023 by Pulumi

    Import

     $ pulumi import datadog:index/logsIndex:LogsIndex name> <indexName>
    

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var sampleIndex = new Datadog.LogsIndex("sampleIndex", new()
        {
            DailyLimit = 200000,
            ExclusionFilters = new[]
            {
                new Datadog.Inputs.LogsIndexExclusionFilterArgs
                {
                    Filters = new[]
                    {
                        new Datadog.Inputs.LogsIndexExclusionFilterFilterArgs
                        {
                            Query = "app:coredns",
                            SampleRate = 0.97,
                        },
                    },
                    IsEnabled = true,
                    Name = "Filter coredns logs",
                },
                new Datadog.Inputs.LogsIndexExclusionFilterArgs
                {
                    Filters = new[]
                    {
                        new Datadog.Inputs.LogsIndexExclusionFilterFilterArgs
                        {
                            Query = "service:kube_apiserver",
                            SampleRate = 1,
                        },
                    },
                    IsEnabled = true,
                    Name = "Kubernetes apiserver",
                },
            },
            Filters = new[]
            {
                new Datadog.Inputs.LogsIndexFilterArgs
                {
                    Query = "*",
                },
            },
            Name = "your index",
            RetentionDays = 7,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := datadog.NewLogsIndex(ctx, "sampleIndex", &datadog.LogsIndexArgs{
    			DailyLimit: pulumi.Int(200000),
    			ExclusionFilters: datadog.LogsIndexExclusionFilterArray{
    				&datadog.LogsIndexExclusionFilterArgs{
    					Filters: datadog.LogsIndexExclusionFilterFilterArray{
    						&datadog.LogsIndexExclusionFilterFilterArgs{
    							Query:      pulumi.String("app:coredns"),
    							SampleRate: pulumi.Float64(0.97),
    						},
    					},
    					IsEnabled: pulumi.Bool(true),
    					Name:      pulumi.String("Filter coredns logs"),
    				},
    				&datadog.LogsIndexExclusionFilterArgs{
    					Filters: datadog.LogsIndexExclusionFilterFilterArray{
    						&datadog.LogsIndexExclusionFilterFilterArgs{
    							Query:      pulumi.String("service:kube_apiserver"),
    							SampleRate: pulumi.Float64(1),
    						},
    					},
    					IsEnabled: pulumi.Bool(true),
    					Name:      pulumi.String("Kubernetes apiserver"),
    				},
    			},
    			Filters: datadog.LogsIndexFilterArray{
    				&datadog.LogsIndexFilterArgs{
    					Query: pulumi.String("*"),
    				},
    			},
    			Name:          pulumi.String("your index"),
    			RetentionDays: pulumi.Int(7),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.LogsIndex;
    import com.pulumi.datadog.LogsIndexArgs;
    import com.pulumi.datadog.inputs.LogsIndexExclusionFilterArgs;
    import com.pulumi.datadog.inputs.LogsIndexFilterArgs;
    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) {
            var sampleIndex = new LogsIndex("sampleIndex", LogsIndexArgs.builder()        
                .dailyLimit(200000)
                .exclusionFilters(            
                    LogsIndexExclusionFilterArgs.builder()
                        .filters(LogsIndexExclusionFilterFilterArgs.builder()
                            .query("app:coredns")
                            .sampleRate(0.97)
                            .build())
                        .isEnabled(true)
                        .name("Filter coredns logs")
                        .build(),
                    LogsIndexExclusionFilterArgs.builder()
                        .filters(LogsIndexExclusionFilterFilterArgs.builder()
                            .query("service:kube_apiserver")
                            .sampleRate(1)
                            .build())
                        .isEnabled(true)
                        .name("Kubernetes apiserver")
                        .build())
                .filters(LogsIndexFilterArgs.builder()
                    .query("*")
                    .build())
                .name("your index")
                .retentionDays(7)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_datadog as datadog
    
    sample_index = datadog.LogsIndex("sampleIndex",
        daily_limit=200000,
        exclusion_filters=[
            datadog.LogsIndexExclusionFilterArgs(
                filters=[datadog.LogsIndexExclusionFilterFilterArgs(
                    query="app:coredns",
                    sample_rate=0.97,
                )],
                is_enabled=True,
                name="Filter coredns logs",
            ),
            datadog.LogsIndexExclusionFilterArgs(
                filters=[datadog.LogsIndexExclusionFilterFilterArgs(
                    query="service:kube_apiserver",
                    sample_rate=1,
                )],
                is_enabled=True,
                name="Kubernetes apiserver",
            ),
        ],
        filters=[datadog.LogsIndexFilterArgs(
            query="*",
        )],
        name="your index",
        retention_days=7)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const sampleIndex = new datadog.LogsIndex("sampleIndex", {
        dailyLimit: 200000,
        exclusionFilters: [
            {
                filters: [{
                    query: "app:coredns",
                    sampleRate: 0.97,
                }],
                isEnabled: true,
                name: "Filter coredns logs",
            },
            {
                filters: [{
                    query: "service:kube_apiserver",
                    sampleRate: 1,
                }],
                isEnabled: true,
                name: "Kubernetes apiserver",
            },
        ],
        filters: [{
            query: "*",
        }],
        name: "your index",
        retentionDays: 7,
    });
    
    resources:
      sampleIndex:
        type: datadog:LogsIndex
        properties:
          dailyLimit: 200000
          exclusionFilters:
            - filters:
                - query: app:coredns
                  sampleRate: 0.97
              isEnabled: true
              name: Filter coredns logs
            - filters:
                - query: service:kube_apiserver
                  sampleRate: 1
              isEnabled: true
              name: Kubernetes apiserver
          filters:
            - query: '*'
          name: your index
          retentionDays: 7
    

    Create LogsIndex Resource

    new LogsIndex(name: string, args: LogsIndexArgs, opts?: CustomResourceOptions);
    @overload
    def LogsIndex(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  daily_limit: Optional[int] = None,
                  disable_daily_limit: Optional[bool] = None,
                  exclusion_filters: Optional[Sequence[LogsIndexExclusionFilterArgs]] = None,
                  filters: Optional[Sequence[LogsIndexFilterArgs]] = None,
                  name: Optional[str] = None,
                  retention_days: Optional[int] = None)
    @overload
    def LogsIndex(resource_name: str,
                  args: LogsIndexArgs,
                  opts: Optional[ResourceOptions] = None)
    func NewLogsIndex(ctx *Context, name string, args LogsIndexArgs, opts ...ResourceOption) (*LogsIndex, error)
    public LogsIndex(string name, LogsIndexArgs args, CustomResourceOptions? opts = null)
    public LogsIndex(String name, LogsIndexArgs args)
    public LogsIndex(String name, LogsIndexArgs args, CustomResourceOptions options)
    
    type: datadog:LogsIndex
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args LogsIndexArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args LogsIndexArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args LogsIndexArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogsIndexArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogsIndexArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    LogsIndex Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The LogsIndex resource accepts the following input properties:

    Filters List<LogsIndexFilter>

    Logs filter

    Name string

    The name of the index.

    DailyLimit int

    The number of log events you can send in this index per day before you are rate-limited.

    DisableDailyLimit bool

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    ExclusionFilters List<LogsIndexExclusionFilter>

    List of exclusion filters.

    RetentionDays int

    The number of days before logs are deleted from this index.

    Filters []LogsIndexFilterArgs

    Logs filter

    Name string

    The name of the index.

    DailyLimit int

    The number of log events you can send in this index per day before you are rate-limited.

    DisableDailyLimit bool

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    ExclusionFilters []LogsIndexExclusionFilterArgs

    List of exclusion filters.

    RetentionDays int

    The number of days before logs are deleted from this index.

    filters List<LogsIndexFilter>

    Logs filter

    name String

    The name of the index.

    dailyLimit Integer

    The number of log events you can send in this index per day before you are rate-limited.

    disableDailyLimit Boolean

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusionFilters List<LogsIndexExclusionFilter>

    List of exclusion filters.

    retentionDays Integer

    The number of days before logs are deleted from this index.

    filters LogsIndexFilter[]

    Logs filter

    name string

    The name of the index.

    dailyLimit number

    The number of log events you can send in this index per day before you are rate-limited.

    disableDailyLimit boolean

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusionFilters LogsIndexExclusionFilter[]

    List of exclusion filters.

    retentionDays number

    The number of days before logs are deleted from this index.

    filters Sequence[LogsIndexFilterArgs]

    Logs filter

    name str

    The name of the index.

    daily_limit int

    The number of log events you can send in this index per day before you are rate-limited.

    disable_daily_limit bool

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusion_filters Sequence[LogsIndexExclusionFilterArgs]

    List of exclusion filters.

    retention_days int

    The number of days before logs are deleted from this index.

    filters List<Property Map>

    Logs filter

    name String

    The name of the index.

    dailyLimit Number

    The number of log events you can send in this index per day before you are rate-limited.

    disableDailyLimit Boolean

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusionFilters List<Property Map>

    List of exclusion filters.

    retentionDays Number

    The number of days before logs are deleted from this index.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LogsIndex resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    id string

    The provider-assigned unique ID for this managed resource.

    id str

    The provider-assigned unique ID for this managed resource.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing LogsIndex Resource

    Get an existing LogsIndex resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: LogsIndexState, opts?: CustomResourceOptions): LogsIndex
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            daily_limit: Optional[int] = None,
            disable_daily_limit: Optional[bool] = None,
            exclusion_filters: Optional[Sequence[LogsIndexExclusionFilterArgs]] = None,
            filters: Optional[Sequence[LogsIndexFilterArgs]] = None,
            name: Optional[str] = None,
            retention_days: Optional[int] = None) -> LogsIndex
    func GetLogsIndex(ctx *Context, name string, id IDInput, state *LogsIndexState, opts ...ResourceOption) (*LogsIndex, error)
    public static LogsIndex Get(string name, Input<string> id, LogsIndexState? state, CustomResourceOptions? opts = null)
    public static LogsIndex get(String name, Output<String> id, LogsIndexState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DailyLimit int

    The number of log events you can send in this index per day before you are rate-limited.

    DisableDailyLimit bool

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    ExclusionFilters List<LogsIndexExclusionFilter>

    List of exclusion filters.

    Filters List<LogsIndexFilter>

    Logs filter

    Name string

    The name of the index.

    RetentionDays int

    The number of days before logs are deleted from this index.

    DailyLimit int

    The number of log events you can send in this index per day before you are rate-limited.

    DisableDailyLimit bool

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    ExclusionFilters []LogsIndexExclusionFilterArgs

    List of exclusion filters.

    Filters []LogsIndexFilterArgs

    Logs filter

    Name string

    The name of the index.

    RetentionDays int

    The number of days before logs are deleted from this index.

    dailyLimit Integer

    The number of log events you can send in this index per day before you are rate-limited.

    disableDailyLimit Boolean

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusionFilters List<LogsIndexExclusionFilter>

    List of exclusion filters.

    filters List<LogsIndexFilter>

    Logs filter

    name String

    The name of the index.

    retentionDays Integer

    The number of days before logs are deleted from this index.

    dailyLimit number

    The number of log events you can send in this index per day before you are rate-limited.

    disableDailyLimit boolean

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusionFilters LogsIndexExclusionFilter[]

    List of exclusion filters.

    filters LogsIndexFilter[]

    Logs filter

    name string

    The name of the index.

    retentionDays number

    The number of days before logs are deleted from this index.

    daily_limit int

    The number of log events you can send in this index per day before you are rate-limited.

    disable_daily_limit bool

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusion_filters Sequence[LogsIndexExclusionFilterArgs]

    List of exclusion filters.

    filters Sequence[LogsIndexFilterArgs]

    Logs filter

    name str

    The name of the index.

    retention_days int

    The number of days before logs are deleted from this index.

    dailyLimit Number

    The number of log events you can send in this index per day before you are rate-limited.

    disableDailyLimit Boolean

    If true, sets the dailylimit value to null and the index is not limited on a daily basis (any specified dailylimit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.

    exclusionFilters List<Property Map>

    List of exclusion filters.

    filters List<Property Map>

    Logs filter

    name String

    The name of the index.

    retentionDays Number

    The number of days before logs are deleted from this index.

    Supporting Types

    LogsIndexExclusionFilter, LogsIndexExclusionFilterArgs

    Filters List<LogsIndexExclusionFilterFilter>

    Logs filter

    IsEnabled bool

    A boolean stating if the exclusion is active or not.

    Name string

    The name of the exclusion filter.

    Filters []LogsIndexExclusionFilterFilter

    Logs filter

    IsEnabled bool

    A boolean stating if the exclusion is active or not.

    Name string

    The name of the exclusion filter.

    filters List<LogsIndexExclusionFilterFilter>

    Logs filter

    isEnabled Boolean

    A boolean stating if the exclusion is active or not.

    name String

    The name of the exclusion filter.

    filters LogsIndexExclusionFilterFilter[]

    Logs filter

    isEnabled boolean

    A boolean stating if the exclusion is active or not.

    name string

    The name of the exclusion filter.

    filters Sequence[LogsIndexExclusionFilterFilter]

    Logs filter

    is_enabled bool

    A boolean stating if the exclusion is active or not.

    name str

    The name of the exclusion filter.

    filters List<Property Map>

    Logs filter

    isEnabled Boolean

    A boolean stating if the exclusion is active or not.

    name String

    The name of the exclusion filter.

    LogsIndexExclusionFilterFilter, LogsIndexExclusionFilterFilterArgs

    Query string

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    SampleRate double
    Query string

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    SampleRate float64
    query String

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    sampleRate Double
    query string

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    sampleRate number
    query str

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    sample_rate float
    query String

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    sampleRate Number

    LogsIndexFilter, LogsIndexFilterArgs

    Query string

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    Query string

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    query String

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    query string

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    query str

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    query String

    Logs filter criteria. Only logs matching this filter criteria are considered for this index.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the datadog Terraform Provider.

    datadog logo
    Datadog v4.23.0 published on Wednesday, Sep 27, 2023 by Pulumi