1. Packages
  2. Elasticstack Provider
  3. API Docs
  4. getElasticsearchIngestProcessorKv
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

elasticstack.getElasticsearchIngestProcessorKv

Explore with Pulumi AI

elasticstack logo
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

    This processor helps automatically parse messages (or specific event fields) which are of the foo=bar variety.

    See: https://www.elastic.co/guide/en/elasticsearch/reference/current/kv-processor.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const kv = elasticstack.getElasticsearchIngestProcessorKv({
        field: "message",
        fieldSplit: " ",
        valueSplit: "=",
        excludeKeys: ["tags"],
        prefix: "setting_",
    });
    const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [kv.then(kv => kv.json)]});
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    kv = elasticstack.get_elasticsearch_ingest_processor_kv(field="message",
        field_split=" ",
        value_split="=",
        exclude_keys=["tags"],
        prefix="setting_")
    my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[kv.json])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/elasticstack/elasticstack"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		kv, err := elasticstack.GetElasticsearchIngestProcessorKv(ctx, &elasticstack.GetElasticsearchIngestProcessorKvArgs{
    			Field:      "message",
    			FieldSplit: " ",
    			ValueSplit: "=",
    			ExcludeKeys: []string{
    				"tags",
    			},
    			Prefix: pulumi.StringRef("setting_"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
    			Processors: pulumi.StringArray{
    				pulumi.String(kv.Json),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var kv = Elasticstack.GetElasticsearchIngestProcessorKv.Invoke(new()
        {
            Field = "message",
            FieldSplit = " ",
            ValueSplit = "=",
            ExcludeKeys = new[]
            {
                "tags",
            },
            Prefix = "setting_",
        });
    
        var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
        {
            Processors = new[]
            {
                kv.Apply(getElasticsearchIngestProcessorKvResult => getElasticsearchIngestProcessorKvResult.Json),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.elasticstack.ElasticstackFunctions;
    import com.pulumi.elasticstack.inputs.GetElasticsearchIngestProcessorKvArgs;
    import com.pulumi.elasticstack.ElasticsearchIngestPipeline;
    import com.pulumi.elasticstack.ElasticsearchIngestPipelineArgs;
    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 kv = ElasticstackFunctions.getElasticsearchIngestProcessorKv(GetElasticsearchIngestProcessorKvArgs.builder()
                .field("message")
                .fieldSplit(" ")
                .valueSplit("=")
                .excludeKeys("tags")
                .prefix("setting_")
                .build());
    
            var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
                .processors(kv.applyValue(getElasticsearchIngestProcessorKvResult -> getElasticsearchIngestProcessorKvResult.json()))
                .build());
    
        }
    }
    
    resources:
      myIngestPipeline:
        type: elasticstack:ElasticsearchIngestPipeline
        properties:
          processors:
            - ${kv.json}
    variables:
      kv:
        fn::invoke:
          function: elasticstack:getElasticsearchIngestProcessorKv
          arguments:
            field: message
            fieldSplit: ' '
            valueSplit: =
            excludeKeys:
              - tags
            prefix: setting_
    

    Using getElasticsearchIngestProcessorKv

    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 getElasticsearchIngestProcessorKv(args: GetElasticsearchIngestProcessorKvArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorKvResult>
    function getElasticsearchIngestProcessorKvOutput(args: GetElasticsearchIngestProcessorKvOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorKvResult>
    def get_elasticsearch_ingest_processor_kv(description: Optional[str] = None,
                                              exclude_keys: Optional[Sequence[str]] = None,
                                              field: Optional[str] = None,
                                              field_split: Optional[str] = None,
                                              if_: Optional[str] = None,
                                              ignore_failure: Optional[bool] = None,
                                              ignore_missing: Optional[bool] = None,
                                              include_keys: Optional[Sequence[str]] = None,
                                              on_failures: Optional[Sequence[str]] = None,
                                              prefix: Optional[str] = None,
                                              strip_brackets: Optional[bool] = None,
                                              tag: Optional[str] = None,
                                              target_field: Optional[str] = None,
                                              trim_key: Optional[str] = None,
                                              trim_value: Optional[str] = None,
                                              value_split: Optional[str] = None,
                                              opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorKvResult
    def get_elasticsearch_ingest_processor_kv_output(description: Optional[pulumi.Input[str]] = None,
                                              exclude_keys: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                              field: Optional[pulumi.Input[str]] = None,
                                              field_split: Optional[pulumi.Input[str]] = None,
                                              if_: Optional[pulumi.Input[str]] = None,
                                              ignore_failure: Optional[pulumi.Input[bool]] = None,
                                              ignore_missing: Optional[pulumi.Input[bool]] = None,
                                              include_keys: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                              on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                              prefix: Optional[pulumi.Input[str]] = None,
                                              strip_brackets: Optional[pulumi.Input[bool]] = None,
                                              tag: Optional[pulumi.Input[str]] = None,
                                              target_field: Optional[pulumi.Input[str]] = None,
                                              trim_key: Optional[pulumi.Input[str]] = None,
                                              trim_value: Optional[pulumi.Input[str]] = None,
                                              value_split: Optional[pulumi.Input[str]] = None,
                                              opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorKvResult]
    func GetElasticsearchIngestProcessorKv(ctx *Context, args *GetElasticsearchIngestProcessorKvArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorKvResult, error)
    func GetElasticsearchIngestProcessorKvOutput(ctx *Context, args *GetElasticsearchIngestProcessorKvOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorKvResultOutput

    > Note: This function is named GetElasticsearchIngestProcessorKv in the Go SDK.

    public static class GetElasticsearchIngestProcessorKv 
    {
        public static Task<GetElasticsearchIngestProcessorKvResult> InvokeAsync(GetElasticsearchIngestProcessorKvArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchIngestProcessorKvResult> Invoke(GetElasticsearchIngestProcessorKvInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchIngestProcessorKvResult> getElasticsearchIngestProcessorKv(GetElasticsearchIngestProcessorKvArgs args, InvokeOptions options)
    public static Output<GetElasticsearchIngestProcessorKvResult> getElasticsearchIngestProcessorKv(GetElasticsearchIngestProcessorKvArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchIngestProcessorKv:getElasticsearchIngestProcessorKv
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Field string
    The field to be parsed. Supports template snippets.
    FieldSplit string
    Regex pattern to use for splitting key-value pairs.
    ValueSplit string
    Regex pattern to use for splitting the key from the value within a key-value pair.
    Description string
    Description of the processor.
    ExcludeKeys List<string>
    List of keys to exclude from document
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    IgnoreMissing bool
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    IncludeKeys List<string>
    List of keys to filter and insert into document. Defaults to including all keys
    OnFailures List<string>
    Handle failures for the processor.
    Prefix string
    Prefix to be added to extracted keys.
    StripBrackets bool
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to insert the extracted keys into. Defaults to the root of the document.
    TrimKey string
    String of characters to trim from extracted keys.
    TrimValue string
    String of characters to trim from extracted values.
    Field string
    The field to be parsed. Supports template snippets.
    FieldSplit string
    Regex pattern to use for splitting key-value pairs.
    ValueSplit string
    Regex pattern to use for splitting the key from the value within a key-value pair.
    Description string
    Description of the processor.
    ExcludeKeys []string
    List of keys to exclude from document
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    IgnoreMissing bool
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    IncludeKeys []string
    List of keys to filter and insert into document. Defaults to including all keys
    OnFailures []string
    Handle failures for the processor.
    Prefix string
    Prefix to be added to extracted keys.
    StripBrackets bool
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to insert the extracted keys into. Defaults to the root of the document.
    TrimKey string
    String of characters to trim from extracted keys.
    TrimValue string
    String of characters to trim from extracted values.
    field String
    The field to be parsed. Supports template snippets.
    fieldSplit String
    Regex pattern to use for splitting key-value pairs.
    valueSplit String
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description String
    Description of the processor.
    excludeKeys List<String>
    List of keys to exclude from document
    if_ String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    ignoreMissing Boolean
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    includeKeys List<String>
    List of keys to filter and insert into document. Defaults to including all keys
    onFailures List<String>
    Handle failures for the processor.
    prefix String
    Prefix to be added to extracted keys.
    stripBrackets Boolean
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag String
    Identifier for the processor.
    targetField String
    The field to insert the extracted keys into. Defaults to the root of the document.
    trimKey String
    String of characters to trim from extracted keys.
    trimValue String
    String of characters to trim from extracted values.
    field string
    The field to be parsed. Supports template snippets.
    fieldSplit string
    Regex pattern to use for splitting key-value pairs.
    valueSplit string
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description string
    Description of the processor.
    excludeKeys string[]
    List of keys to exclude from document
    if string
    Conditionally execute the processor
    ignoreFailure boolean
    Ignore failures for the processor.
    ignoreMissing boolean
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    includeKeys string[]
    List of keys to filter and insert into document. Defaults to including all keys
    onFailures string[]
    Handle failures for the processor.
    prefix string
    Prefix to be added to extracted keys.
    stripBrackets boolean
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag string
    Identifier for the processor.
    targetField string
    The field to insert the extracted keys into. Defaults to the root of the document.
    trimKey string
    String of characters to trim from extracted keys.
    trimValue string
    String of characters to trim from extracted values.
    field str
    The field to be parsed. Supports template snippets.
    field_split str
    Regex pattern to use for splitting key-value pairs.
    value_split str
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description str
    Description of the processor.
    exclude_keys Sequence[str]
    List of keys to exclude from document
    if_ str
    Conditionally execute the processor
    ignore_failure bool
    Ignore failures for the processor.
    ignore_missing bool
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    include_keys Sequence[str]
    List of keys to filter and insert into document. Defaults to including all keys
    on_failures Sequence[str]
    Handle failures for the processor.
    prefix str
    Prefix to be added to extracted keys.
    strip_brackets bool
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag str
    Identifier for the processor.
    target_field str
    The field to insert the extracted keys into. Defaults to the root of the document.
    trim_key str
    String of characters to trim from extracted keys.
    trim_value str
    String of characters to trim from extracted values.
    field String
    The field to be parsed. Supports template snippets.
    fieldSplit String
    Regex pattern to use for splitting key-value pairs.
    valueSplit String
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description String
    Description of the processor.
    excludeKeys List<String>
    List of keys to exclude from document
    if String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    ignoreMissing Boolean
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    includeKeys List<String>
    List of keys to filter and insert into document. Defaults to including all keys
    onFailures List<String>
    Handle failures for the processor.
    prefix String
    Prefix to be added to extracted keys.
    stripBrackets Boolean
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag String
    Identifier for the processor.
    targetField String
    The field to insert the extracted keys into. Defaults to the root of the document.
    trimKey String
    String of characters to trim from extracted keys.
    trimValue String
    String of characters to trim from extracted values.

    getElasticsearchIngestProcessorKv Result

    The following output properties are available:

    Field string
    The field to be parsed. Supports template snippets.
    FieldSplit string
    Regex pattern to use for splitting key-value pairs.
    Id string
    Internal identifier of the resource
    Json string
    JSON representation of this data source.
    ValueSplit string
    Regex pattern to use for splitting the key from the value within a key-value pair.
    Description string
    Description of the processor.
    ExcludeKeys List<string>
    List of keys to exclude from document
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    IgnoreMissing bool
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    IncludeKeys List<string>
    List of keys to filter and insert into document. Defaults to including all keys
    OnFailures List<string>
    Handle failures for the processor.
    Prefix string
    Prefix to be added to extracted keys.
    StripBrackets bool
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to insert the extracted keys into. Defaults to the root of the document.
    TrimKey string
    String of characters to trim from extracted keys.
    TrimValue string
    String of characters to trim from extracted values.
    Field string
    The field to be parsed. Supports template snippets.
    FieldSplit string
    Regex pattern to use for splitting key-value pairs.
    Id string
    Internal identifier of the resource
    Json string
    JSON representation of this data source.
    ValueSplit string
    Regex pattern to use for splitting the key from the value within a key-value pair.
    Description string
    Description of the processor.
    ExcludeKeys []string
    List of keys to exclude from document
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    IgnoreMissing bool
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    IncludeKeys []string
    List of keys to filter and insert into document. Defaults to including all keys
    OnFailures []string
    Handle failures for the processor.
    Prefix string
    Prefix to be added to extracted keys.
    StripBrackets bool
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to insert the extracted keys into. Defaults to the root of the document.
    TrimKey string
    String of characters to trim from extracted keys.
    TrimValue string
    String of characters to trim from extracted values.
    field String
    The field to be parsed. Supports template snippets.
    fieldSplit String
    Regex pattern to use for splitting key-value pairs.
    id String
    Internal identifier of the resource
    json String
    JSON representation of this data source.
    valueSplit String
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description String
    Description of the processor.
    excludeKeys List<String>
    List of keys to exclude from document
    if_ String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    ignoreMissing Boolean
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    includeKeys List<String>
    List of keys to filter and insert into document. Defaults to including all keys
    onFailures List<String>
    Handle failures for the processor.
    prefix String
    Prefix to be added to extracted keys.
    stripBrackets Boolean
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag String
    Identifier for the processor.
    targetField String
    The field to insert the extracted keys into. Defaults to the root of the document.
    trimKey String
    String of characters to trim from extracted keys.
    trimValue String
    String of characters to trim from extracted values.
    field string
    The field to be parsed. Supports template snippets.
    fieldSplit string
    Regex pattern to use for splitting key-value pairs.
    id string
    Internal identifier of the resource
    json string
    JSON representation of this data source.
    valueSplit string
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description string
    Description of the processor.
    excludeKeys string[]
    List of keys to exclude from document
    if string
    Conditionally execute the processor
    ignoreFailure boolean
    Ignore failures for the processor.
    ignoreMissing boolean
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    includeKeys string[]
    List of keys to filter and insert into document. Defaults to including all keys
    onFailures string[]
    Handle failures for the processor.
    prefix string
    Prefix to be added to extracted keys.
    stripBrackets boolean
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag string
    Identifier for the processor.
    targetField string
    The field to insert the extracted keys into. Defaults to the root of the document.
    trimKey string
    String of characters to trim from extracted keys.
    trimValue string
    String of characters to trim from extracted values.
    field str
    The field to be parsed. Supports template snippets.
    field_split str
    Regex pattern to use for splitting key-value pairs.
    id str
    Internal identifier of the resource
    json str
    JSON representation of this data source.
    value_split str
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description str
    Description of the processor.
    exclude_keys Sequence[str]
    List of keys to exclude from document
    if_ str
    Conditionally execute the processor
    ignore_failure bool
    Ignore failures for the processor.
    ignore_missing bool
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    include_keys Sequence[str]
    List of keys to filter and insert into document. Defaults to including all keys
    on_failures Sequence[str]
    Handle failures for the processor.
    prefix str
    Prefix to be added to extracted keys.
    strip_brackets bool
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag str
    Identifier for the processor.
    target_field str
    The field to insert the extracted keys into. Defaults to the root of the document.
    trim_key str
    String of characters to trim from extracted keys.
    trim_value str
    String of characters to trim from extracted values.
    field String
    The field to be parsed. Supports template snippets.
    fieldSplit String
    Regex pattern to use for splitting key-value pairs.
    id String
    Internal identifier of the resource
    json String
    JSON representation of this data source.
    valueSplit String
    Regex pattern to use for splitting the key from the value within a key-value pair.
    description String
    Description of the processor.
    excludeKeys List<String>
    List of keys to exclude from document
    if String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    ignoreMissing Boolean
    If true and field does not exist or is null, the processor quietly exits without modifying the document.
    includeKeys List<String>
    List of keys to filter and insert into document. Defaults to including all keys
    onFailures List<String>
    Handle failures for the processor.
    prefix String
    Prefix to be added to extracted keys.
    stripBrackets Boolean
    If true strip brackets (), <>, [] as well as quotes ' and " from extracted values.
    tag String
    Identifier for the processor.
    targetField String
    The field to insert the extracted keys into. Defaults to the root of the document.
    trimKey String
    String of characters to trim from extracted keys.
    trimValue String
    String of characters to trim from extracted values.

    Package Details

    Repository
    elasticstack elastic/terraform-provider-elasticstack
    License
    Notes
    This Pulumi package is based on the elasticstack Terraform Provider.
    elasticstack logo
    elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic