1. Packages
  2. Logdna Provider
  3. API Docs
  4. StreamExclusion
logdna 1.16.0 published on Monday, Apr 14, 2025 by logdna

logdna.StreamExclusion

Explore with Pulumi AI

logdna logo
logdna 1.16.0 published on Monday, Apr 14, 2025 by logdna

    # Resource: logdna.StreamExclusion

    IBM Log Analysis and Cloud Activity Tracker users only

    Manages exclusion rules for LogDNA Streaming. Stream exclusion rules define the applications, hostnames, and patterns within log lines that should exclude a given line from the stream.

    Example

    import * as pulumi from "@pulumi/pulumi";
    import * as logdna from "@pulumi/logdna";
    
    const http_success = new logdna.StreamExclusion("http-success", {
        active: true,
        apps: [
            "nginx",
            "apache",
        ],
        query: "response:(>=200 <300) request:*",
        title: "HTTP 2XX",
    });
    const http_noise = new logdna.StreamExclusion("http-noise", {
        active: true,
        apps: [
            "nginx",
            "apache",
        ],
        query: "robots.txt OR favicon.ico OR .well-known",
        title: "Noisy HTTP Paths",
    });
    
    import pulumi
    import pulumi_logdna as logdna
    
    http_success = logdna.StreamExclusion("http-success",
        active=True,
        apps=[
            "nginx",
            "apache",
        ],
        query="response:(>=200 <300) request:*",
        title="HTTP 2XX")
    http_noise = logdna.StreamExclusion("http-noise",
        active=True,
        apps=[
            "nginx",
            "apache",
        ],
        query="robots.txt OR favicon.ico OR .well-known",
        title="Noisy HTTP Paths")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/logdna/logdna"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := logdna.NewStreamExclusion(ctx, "http-success", &logdna.StreamExclusionArgs{
    			Active: pulumi.Bool(true),
    			Apps: pulumi.StringArray{
    				pulumi.String("nginx"),
    				pulumi.String("apache"),
    			},
    			Query: pulumi.String("response:(>=200 <300) request:*"),
    			Title: pulumi.String("HTTP 2XX"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = logdna.NewStreamExclusion(ctx, "http-noise", &logdna.StreamExclusionArgs{
    			Active: pulumi.Bool(true),
    			Apps: pulumi.StringArray{
    				pulumi.String("nginx"),
    				pulumi.String("apache"),
    			},
    			Query: pulumi.String("robots.txt OR favicon.ico OR .well-known"),
    			Title: pulumi.String("Noisy HTTP Paths"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Logdna = Pulumi.Logdna;
    
    return await Deployment.RunAsync(() => 
    {
        var http_success = new Logdna.StreamExclusion("http-success", new()
        {
            Active = true,
            Apps = new[]
            {
                "nginx",
                "apache",
            },
            Query = "response:(>=200 <300) request:*",
            Title = "HTTP 2XX",
        });
    
        var http_noise = new Logdna.StreamExclusion("http-noise", new()
        {
            Active = true,
            Apps = new[]
            {
                "nginx",
                "apache",
            },
            Query = "robots.txt OR favicon.ico OR .well-known",
            Title = "Noisy HTTP Paths",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.logdna.StreamExclusion;
    import com.pulumi.logdna.StreamExclusionArgs;
    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 http_success = new StreamExclusion("http-success", StreamExclusionArgs.builder()
                .active(true)
                .apps(            
                    "nginx",
                    "apache")
                .query("response:(>=200 <300) request:*")
                .title("HTTP 2XX")
                .build());
    
            var http_noise = new StreamExclusion("http-noise", StreamExclusionArgs.builder()
                .active(true)
                .apps(            
                    "nginx",
                    "apache")
                .query("robots.txt OR favicon.ico OR .well-known")
                .title("Noisy HTTP Paths")
                .build());
    
        }
    }
    
    resources:
      http-success:
        type: logdna:StreamExclusion
        properties:
          active: true
          apps:
            - nginx
            - apache
          query: response:(>=200 <300) request:*
          title: HTTP 2XX
      http-noise:
        type: logdna:StreamExclusion
        properties:
          active: true
          apps:
            - nginx
            - apache
          query: robots.txt OR favicon.ico OR .well-known
          title: Noisy HTTP Paths
    

    Create StreamExclusion Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new StreamExclusion(name: string, args?: StreamExclusionArgs, opts?: CustomResourceOptions);
    @overload
    def StreamExclusion(resource_name: str,
                        args: Optional[StreamExclusionArgs] = None,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def StreamExclusion(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        active: Optional[bool] = None,
                        apps: Optional[Sequence[str]] = None,
                        hosts: Optional[Sequence[str]] = None,
                        query: Optional[str] = None,
                        title: Optional[str] = None)
    func NewStreamExclusion(ctx *Context, name string, args *StreamExclusionArgs, opts ...ResourceOption) (*StreamExclusion, error)
    public StreamExclusion(string name, StreamExclusionArgs? args = null, CustomResourceOptions? opts = null)
    public StreamExclusion(String name, StreamExclusionArgs args)
    public StreamExclusion(String name, StreamExclusionArgs args, CustomResourceOptions options)
    
    type: logdna:StreamExclusion
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args StreamExclusionArgs
    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 StreamExclusionArgs
    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 StreamExclusionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args StreamExclusionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args StreamExclusionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var streamExclusionResource = new Logdna.StreamExclusion("streamExclusionResource", new()
    {
        Active = false,
        Apps = new[]
        {
            "string",
        },
        Hosts = new[]
        {
            "string",
        },
        Query = "string",
        Title = "string",
    });
    
    example, err := logdna.NewStreamExclusion(ctx, "streamExclusionResource", &logdna.StreamExclusionArgs{
    	Active: pulumi.Bool(false),
    	Apps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Hosts: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Query: pulumi.String("string"),
    	Title: pulumi.String("string"),
    })
    
    var streamExclusionResource = new StreamExclusion("streamExclusionResource", StreamExclusionArgs.builder()
        .active(false)
        .apps("string")
        .hosts("string")
        .query("string")
        .title("string")
        .build());
    
    stream_exclusion_resource = logdna.StreamExclusion("streamExclusionResource",
        active=False,
        apps=["string"],
        hosts=["string"],
        query="string",
        title="string")
    
    const streamExclusionResource = new logdna.StreamExclusion("streamExclusionResource", {
        active: false,
        apps: ["string"],
        hosts: ["string"],
        query: "string",
        title: "string",
    });
    
    type: logdna:StreamExclusion
    properties:
        active: false
        apps:
            - string
        hosts:
            - string
        query: string
        title: string
    

    StreamExclusion Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The StreamExclusion resource accepts the following input properties:

    Active bool
    Apps List<string>
    Hosts List<string>
    Query string
    Title string
    Active bool
    Apps []string
    Hosts []string
    Query string
    Title string
    active Boolean
    apps List<String>
    hosts List<String>
    query String
    title String
    active boolean
    apps string[]
    hosts string[]
    query string
    title string
    active bool
    apps Sequence[str]
    hosts Sequence[str]
    query str
    title str
    active Boolean
    apps List<String>
    hosts List<String>
    query String
    title String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the StreamExclusion 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 StreamExclusion Resource

    Get an existing StreamExclusion 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?: StreamExclusionState, opts?: CustomResourceOptions): StreamExclusion
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            apps: Optional[Sequence[str]] = None,
            hosts: Optional[Sequence[str]] = None,
            query: Optional[str] = None,
            title: Optional[str] = None) -> StreamExclusion
    func GetStreamExclusion(ctx *Context, name string, id IDInput, state *StreamExclusionState, opts ...ResourceOption) (*StreamExclusion, error)
    public static StreamExclusion Get(string name, Input<string> id, StreamExclusionState? state, CustomResourceOptions? opts = null)
    public static StreamExclusion get(String name, Output<String> id, StreamExclusionState state, CustomResourceOptions options)
    resources:  _:    type: logdna:StreamExclusion    get:      id: ${id}
    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:
    Active bool
    Apps List<string>
    Hosts List<string>
    Query string
    Title string
    Active bool
    Apps []string
    Hosts []string
    Query string
    Title string
    active Boolean
    apps List<String>
    hosts List<String>
    query String
    title String
    active boolean
    apps string[]
    hosts string[]
    query string
    title string
    active bool
    apps Sequence[str]
    hosts Sequence[str]
    query str
    title str
    active Boolean
    apps List<String>
    hosts List<String>
    query String
    title String

    Import

    Stream Exclusions can be imported by id, which can be found

    in the URL when editing the Stream Exclusion in the web UI:

    Stream Exclusions can be imported by id, which can be found using the List Stream Exclusions API:

    1. Custom HTTP Headers - servicekey: <SERVICE_KEY> or apikey: <SERVICE_KEY>

    curl –request GET \

     --url <API_URL>/v1/config/stream/exclusions \
    
     --header 'Accept: application/json' \
    
     --header 'servicekey: <SERVICE_KEY>'
    
    1. Basic Auth - Authorization: Basic <encodeInBase64(credentials)>.

    Credentials is a string composed of formatted as <username>:<password>, our usage here entails substituting <SERVICE_KEY> as the username and leaving the password blank. The colon separator should still included in the resulting string <SERVICE_KEY>:

    curl –request GET \

     --url <API_URL>/v1/config/stream/exclusions \
    
     --header 'Accept: application/json' \
    
     --header 'Authorization: Basic <BASE_64_ENCODED_CREDENTIALS>'
    
    $ pulumi import logdna:index/streamExclusion:StreamExclusion your-rule-name <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    logdna logdna/terraform-provider-logdna
    License
    Notes
    This Pulumi package is based on the logdna Terraform Provider.
    logdna logo
    logdna 1.16.0 published on Monday, Apr 14, 2025 by logdna