datadog.LogsIndex
Explore with Pulumi AI
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<Logs
Index Filter> Logs filter
- Name string
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 boolLimit 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 List<LogsIndex Exclusion Filter> List of exclusion filters.
- Retention
Days int The number of days before logs are deleted from this index.
- Filters
[]Logs
Index Filter Args Logs filter
- Name string
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 boolLimit 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 []LogsIndex Exclusion Filter Args List of exclusion filters.
- Retention
Days int The number of days before logs are deleted from this index.
- filters
List<Logs
Index Filter> Logs filter
- name String
The name of the index.
- daily
Limit Integer The number of log events you can send in this index per day before you are rate-limited.
- disable
Daily BooleanLimit 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 List<LogsIndex Exclusion Filter> List of exclusion filters.
- retention
Days Integer The number of days before logs are deleted from this index.
- filters
Logs
Index Filter[] Logs filter
- name string
The name of the index.
- daily
Limit number The number of log events you can send in this index per day before you are rate-limited.
- disable
Daily booleanLimit 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 LogsIndex Exclusion Filter[] List of exclusion filters.
- retention
Days number The number of days before logs are deleted from this index.
- filters
Sequence[Logs
Index Filter Args] 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_ boollimit 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[LogsIndex Exclusion Filter Args] 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.
- daily
Limit Number The number of log events you can send in this index per day before you are rate-limited.
- disable
Daily BooleanLimit 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 List<Property Map> List of exclusion filters.
- retention
Days 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.
- Daily
Limit int The number of log events you can send in this index per day before you are rate-limited.
- Disable
Daily boolLimit 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 List<LogsIndex Exclusion Filter> List of exclusion filters.
- Filters
List<Logs
Index Filter> Logs filter
- Name string
The name of the index.
- Retention
Days int 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 boolLimit 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 []LogsIndex Exclusion Filter Args List of exclusion filters.
- Filters
[]Logs
Index Filter Args Logs filter
- Name string
The name of the index.
- Retention
Days int The number of days before logs are deleted from this index.
- daily
Limit Integer The number of log events you can send in this index per day before you are rate-limited.
- disable
Daily BooleanLimit 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 List<LogsIndex Exclusion Filter> List of exclusion filters.
- filters
List<Logs
Index Filter> Logs filter
- name String
The name of the index.
- retention
Days Integer The number of days before logs are deleted from this index.
- daily
Limit number The number of log events you can send in this index per day before you are rate-limited.
- disable
Daily booleanLimit 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 LogsIndex Exclusion Filter[] List of exclusion filters.
- filters
Logs
Index Filter[] Logs filter
- name string
The name of the index.
- retention
Days 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_ boollimit 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[LogsIndex Exclusion Filter Args] List of exclusion filters.
- filters
Sequence[Logs
Index Filter Args] Logs filter
- name str
The name of the index.
- retention_
days int The number of days before logs are deleted from this index.
- daily
Limit Number The number of log events you can send in this index per day before you are rate-limited.
- disable
Daily BooleanLimit 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 List<Property Map> List of exclusion filters.
- filters List<Property Map>
Logs filter
- name String
The name of the index.
- retention
Days Number The number of days before logs are deleted from this index.
Supporting Types
LogsIndexExclusionFilter, LogsIndexExclusionFilterArgs
- Filters
List<Logs
Index Exclusion Filter Filter> Logs filter
- Is
Enabled bool A boolean stating if the exclusion is active or not.
- Name string
The name of the exclusion filter.
- Filters
[]Logs
Index Exclusion Filter Filter Logs filter
- Is
Enabled bool A boolean stating if the exclusion is active or not.
- Name string
The name of the exclusion filter.
- filters
List<Logs
Index Exclusion Filter Filter> Logs filter
- is
Enabled Boolean A boolean stating if the exclusion is active or not.
- name String
The name of the exclusion filter.
- filters
Logs
Index Exclusion Filter Filter[] Logs filter
- is
Enabled boolean A boolean stating if the exclusion is active or not.
- name string
The name of the exclusion filter.
- filters
Sequence[Logs
Index Exclusion Filter Filter] 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
- is
Enabled 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.
- Sample
Rate double
- Query string
Logs filter criteria. Only logs matching this filter criteria are considered for this index.
- Sample
Rate float64
- query String
Logs filter criteria. Only logs matching this filter criteria are considered for this index.
- sample
Rate Double
- query string
Logs filter criteria. Only logs matching this filter criteria are considered for this index.
- sample
Rate 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.
- sample
Rate 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.