1. Packages
  2. Sumologic Provider
  3. API Docs
  4. FieldExtractionRule
Sumo Logic v1.0.7 published on Friday, Apr 11, 2025 by Pulumi

sumologic.FieldExtractionRule

Explore with Pulumi AI

Provides a Sumologic Field Extraction Rule.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as sumologic from "@pulumi/sumologic";

const fieldExtractionRule = new sumologic.FieldExtractionRule("fieldExtractionRule", {
    name: "exampleFieldExtractionRule",
    scope: "_sourceHost=127.0.0.1",
    parseExpression: "csv _raw extract 1 as f1",
    enabled: true,
});
Copy
import pulumi
import pulumi_sumologic as sumologic

field_extraction_rule = sumologic.FieldExtractionRule("fieldExtractionRule",
    name="exampleFieldExtractionRule",
    scope="_sourceHost=127.0.0.1",
    parse_expression="csv _raw extract 1 as f1",
    enabled=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-sumologic/sdk/go/sumologic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sumologic.NewFieldExtractionRule(ctx, "fieldExtractionRule", &sumologic.FieldExtractionRuleArgs{
			Name:            pulumi.String("exampleFieldExtractionRule"),
			Scope:           pulumi.String("_sourceHost=127.0.0.1"),
			ParseExpression: pulumi.String("csv _raw extract 1 as f1"),
			Enabled:         pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using SumoLogic = Pulumi.SumoLogic;

return await Deployment.RunAsync(() => 
{
    var fieldExtractionRule = new SumoLogic.FieldExtractionRule("fieldExtractionRule", new()
    {
        Name = "exampleFieldExtractionRule",
        Scope = "_sourceHost=127.0.0.1",
        ParseExpression = "csv _raw extract 1 as f1",
        Enabled = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sumologic.FieldExtractionRule;
import com.pulumi.sumologic.FieldExtractionRuleArgs;
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 fieldExtractionRule = new FieldExtractionRule("fieldExtractionRule", FieldExtractionRuleArgs.builder()
            .name("exampleFieldExtractionRule")
            .scope("_sourceHost=127.0.0.1")
            .parseExpression("csv _raw extract 1 as f1")
            .enabled(true)
            .build());

    }
}
Copy
resources:
  fieldExtractionRule:
    type: sumologic:FieldExtractionRule
    properties:
      name: exampleFieldExtractionRule
      scope: _sourceHost=127.0.0.1
      parseExpression: csv _raw extract 1 as f1
      enabled: true
Copy

Attributes reference

The following attributes are exported:

  • id - Unique identifier for the field extraction rule.

Create FieldExtractionRule Resource

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

Constructor syntax

new FieldExtractionRule(name: string, args: FieldExtractionRuleArgs, opts?: CustomResourceOptions);
@overload
def FieldExtractionRule(resource_name: str,
                        args: FieldExtractionRuleArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def FieldExtractionRule(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        enabled: Optional[bool] = None,
                        parse_expression: Optional[str] = None,
                        scope: Optional[str] = None,
                        name: Optional[str] = None)
func NewFieldExtractionRule(ctx *Context, name string, args FieldExtractionRuleArgs, opts ...ResourceOption) (*FieldExtractionRule, error)
public FieldExtractionRule(string name, FieldExtractionRuleArgs args, CustomResourceOptions? opts = null)
public FieldExtractionRule(String name, FieldExtractionRuleArgs args)
public FieldExtractionRule(String name, FieldExtractionRuleArgs args, CustomResourceOptions options)
type: sumologic:FieldExtractionRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. FieldExtractionRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. FieldExtractionRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. FieldExtractionRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. FieldExtractionRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. FieldExtractionRuleArgs
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 fieldExtractionRuleResource = new SumoLogic.FieldExtractionRule("fieldExtractionRuleResource", new()
{
    Enabled = false,
    ParseExpression = "string",
    Scope = "string",
    Name = "string",
});
Copy
example, err := sumologic.NewFieldExtractionRule(ctx, "fieldExtractionRuleResource", &sumologic.FieldExtractionRuleArgs{
	Enabled:         pulumi.Bool(false),
	ParseExpression: pulumi.String("string"),
	Scope:           pulumi.String("string"),
	Name:            pulumi.String("string"),
})
Copy
var fieldExtractionRuleResource = new FieldExtractionRule("fieldExtractionRuleResource", FieldExtractionRuleArgs.builder()
    .enabled(false)
    .parseExpression("string")
    .scope("string")
    .name("string")
    .build());
Copy
field_extraction_rule_resource = sumologic.FieldExtractionRule("fieldExtractionRuleResource",
    enabled=False,
    parse_expression="string",
    scope="string",
    name="string")
Copy
const fieldExtractionRuleResource = new sumologic.FieldExtractionRule("fieldExtractionRuleResource", {
    enabled: false,
    parseExpression: "string",
    scope: "string",
    name: "string",
});
Copy
type: sumologic:FieldExtractionRule
properties:
    enabled: false
    name: string
    parseExpression: string
    scope: string
Copy

FieldExtractionRule 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 FieldExtractionRule resource accepts the following input properties:

Enabled This property is required. bool
Is the field extraction rule enabled.
ParseExpression This property is required. string
Describes the fields to be parsed.
Scope This property is required. string
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
Name string
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
Enabled This property is required. bool
Is the field extraction rule enabled.
ParseExpression This property is required. string
Describes the fields to be parsed.
Scope This property is required. string
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
Name string
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
enabled This property is required. Boolean
Is the field extraction rule enabled.
parseExpression This property is required. String
Describes the fields to be parsed.
scope This property is required. String
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
name String
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
enabled This property is required. boolean
Is the field extraction rule enabled.
parseExpression This property is required. string
Describes the fields to be parsed.
scope This property is required. string
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
name string
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
enabled This property is required. bool
Is the field extraction rule enabled.
parse_expression This property is required. str
Describes the fields to be parsed.
scope This property is required. str
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
name str
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
enabled This property is required. Boolean
Is the field extraction rule enabled.
parseExpression This property is required. String
Describes the fields to be parsed.
scope This property is required. String
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
name String
Name of the field extraction rule. Use a name that makes it easy to identify the rule.

Outputs

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

Get an existing FieldExtractionRule 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?: FieldExtractionRuleState, opts?: CustomResourceOptions): FieldExtractionRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        name: Optional[str] = None,
        parse_expression: Optional[str] = None,
        scope: Optional[str] = None) -> FieldExtractionRule
func GetFieldExtractionRule(ctx *Context, name string, id IDInput, state *FieldExtractionRuleState, opts ...ResourceOption) (*FieldExtractionRule, error)
public static FieldExtractionRule Get(string name, Input<string> id, FieldExtractionRuleState? state, CustomResourceOptions? opts = null)
public static FieldExtractionRule get(String name, Output<String> id, FieldExtractionRuleState state, CustomResourceOptions options)
resources:  _:    type: sumologic:FieldExtractionRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Enabled bool
Is the field extraction rule enabled.
Name string
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
ParseExpression string
Describes the fields to be parsed.
Scope string
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
Enabled bool
Is the field extraction rule enabled.
Name string
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
ParseExpression string
Describes the fields to be parsed.
Scope string
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
enabled Boolean
Is the field extraction rule enabled.
name String
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
parseExpression String
Describes the fields to be parsed.
scope String
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
enabled boolean
Is the field extraction rule enabled.
name string
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
parseExpression string
Describes the fields to be parsed.
scope string
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
enabled bool
Is the field extraction rule enabled.
name str
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
parse_expression str
Describes the fields to be parsed.
scope str
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.
enabled Boolean
Is the field extraction rule enabled.
name String
Name of the field extraction rule. Use a name that makes it easy to identify the rule.
parseExpression String
Describes the fields to be parsed.
scope String
Scope of the field extraction rule. This could be a sourceCategory, sourceHost, or any other metadata that describes the data you want to extract from. Think of the Scope as the first portion of an ad hoc search, before the first pipe ( | ). You'll use the Scope to run a search against the rule.

Import

Extraction Rules can be imported using the extraction rule id, e.g.:

hcl

$ pulumi import sumologic:index/fieldExtractionRule:FieldExtractionRule fieldExtractionRule id
Copy

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

Package Details

Repository
Sumo Logic pulumi/pulumi-sumologic
License
Apache-2.0
Notes
This Pulumi package is based on the sumologic Terraform Provider.