elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic
elasticstack.getElasticsearchIngestProcessorKv
Explore with Pulumi AI
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.
- Field
Split string - Regex pattern to use for splitting key-value pairs.
- Value
Split string - Regex pattern to use for splitting the key from the value within a key-value pair.
- Description string
- Description of the processor.
- Exclude
Keys List<string> - List of keys to exclude from document
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Include
Keys List<string> - List of keys to filter and insert into document. Defaults to including all keys
- On
Failures List<string> - Handle failures for the processor.
- Prefix string
- Prefix to be added to extracted keys.
- Strip
Brackets bool - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - Tag string
- Identifier for the processor.
- Target
Field string - The field to insert the extracted keys into. Defaults to the root of the document.
- Trim
Key string - String of characters to trim from extracted keys.
- Trim
Value string - String of characters to trim from extracted values.
- Field string
- The field to be parsed. Supports template snippets.
- Field
Split string - Regex pattern to use for splitting key-value pairs.
- Value
Split string - Regex pattern to use for splitting the key from the value within a key-value pair.
- Description string
- Description of the processor.
- Exclude
Keys []string - List of keys to exclude from document
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Include
Keys []string - List of keys to filter and insert into document. Defaults to including all keys
- On
Failures []string - Handle failures for the processor.
- Prefix string
- Prefix to be added to extracted keys.
- Strip
Brackets bool - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - Tag string
- Identifier for the processor.
- Target
Field string - The field to insert the extracted keys into. Defaults to the root of the document.
- Trim
Key string - String of characters to trim from extracted keys.
- Trim
Value string - String of characters to trim from extracted values.
- field String
- The field to be parsed. Supports template snippets.
- field
Split String - Regex pattern to use for splitting key-value pairs.
- value
Split String - Regex pattern to use for splitting the key from the value within a key-value pair.
- description String
- Description of the processor.
- exclude
Keys List<String> - List of keys to exclude from document
- if_ String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - include
Keys List<String> - List of keys to filter and insert into document. Defaults to including all keys
- on
Failures List<String> - Handle failures for the processor.
- prefix String
- Prefix to be added to extracted keys.
- strip
Brackets Boolean - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - tag String
- Identifier for the processor.
- target
Field String - The field to insert the extracted keys into. Defaults to the root of the document.
- trim
Key String - String of characters to trim from extracted keys.
- trim
Value String - String of characters to trim from extracted values.
- field string
- The field to be parsed. Supports template snippets.
- field
Split string - Regex pattern to use for splitting key-value pairs.
- value
Split string - Regex pattern to use for splitting the key from the value within a key-value pair.
- description string
- Description of the processor.
- exclude
Keys string[] - List of keys to exclude from document
- if string
- Conditionally execute the processor
- ignore
Failure boolean - Ignore failures for the processor.
- ignore
Missing boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - include
Keys string[] - List of keys to filter and insert into document. Defaults to including all keys
- on
Failures string[] - Handle failures for the processor.
- prefix string
- Prefix to be added to extracted keys.
- strip
Brackets boolean - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - tag string
- Identifier for the processor.
- target
Field string - The field to insert the extracted keys into. Defaults to the root of the document.
- trim
Key string - String of characters to trim from extracted keys.
- trim
Value 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
andfield
does not exist or isnull
, 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.
- field
Split String - Regex pattern to use for splitting key-value pairs.
- value
Split String - Regex pattern to use for splitting the key from the value within a key-value pair.
- description String
- Description of the processor.
- exclude
Keys List<String> - List of keys to exclude from document
- if String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - include
Keys List<String> - List of keys to filter and insert into document. Defaults to including all keys
- on
Failures List<String> - Handle failures for the processor.
- prefix String
- Prefix to be added to extracted keys.
- strip
Brackets Boolean - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - tag String
- Identifier for the processor.
- target
Field String - The field to insert the extracted keys into. Defaults to the root of the document.
- trim
Key String - String of characters to trim from extracted keys.
- trim
Value 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.
- Field
Split 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.
- Value
Split string - Regex pattern to use for splitting the key from the value within a key-value pair.
- Description string
- Description of the processor.
- Exclude
Keys List<string> - List of keys to exclude from document
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Include
Keys List<string> - List of keys to filter and insert into document. Defaults to including all keys
- On
Failures List<string> - Handle failures for the processor.
- Prefix string
- Prefix to be added to extracted keys.
- Strip
Brackets bool - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - Tag string
- Identifier for the processor.
- Target
Field string - The field to insert the extracted keys into. Defaults to the root of the document.
- Trim
Key string - String of characters to trim from extracted keys.
- Trim
Value string - String of characters to trim from extracted values.
- Field string
- The field to be parsed. Supports template snippets.
- Field
Split 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.
- Value
Split string - Regex pattern to use for splitting the key from the value within a key-value pair.
- Description string
- Description of the processor.
- Exclude
Keys []string - List of keys to exclude from document
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Include
Keys []string - List of keys to filter and insert into document. Defaults to including all keys
- On
Failures []string - Handle failures for the processor.
- Prefix string
- Prefix to be added to extracted keys.
- Strip
Brackets bool - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - Tag string
- Identifier for the processor.
- Target
Field string - The field to insert the extracted keys into. Defaults to the root of the document.
- Trim
Key string - String of characters to trim from extracted keys.
- Trim
Value string - String of characters to trim from extracted values.
- field String
- The field to be parsed. Supports template snippets.
- field
Split 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.
- value
Split String - Regex pattern to use for splitting the key from the value within a key-value pair.
- description String
- Description of the processor.
- exclude
Keys List<String> - List of keys to exclude from document
- if_ String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - include
Keys List<String> - List of keys to filter and insert into document. Defaults to including all keys
- on
Failures List<String> - Handle failures for the processor.
- prefix String
- Prefix to be added to extracted keys.
- strip
Brackets Boolean - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - tag String
- Identifier for the processor.
- target
Field String - The field to insert the extracted keys into. Defaults to the root of the document.
- trim
Key String - String of characters to trim from extracted keys.
- trim
Value String - String of characters to trim from extracted values.
- field string
- The field to be parsed. Supports template snippets.
- field
Split 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.
- value
Split string - Regex pattern to use for splitting the key from the value within a key-value pair.
- description string
- Description of the processor.
- exclude
Keys string[] - List of keys to exclude from document
- if string
- Conditionally execute the processor
- ignore
Failure boolean - Ignore failures for the processor.
- ignore
Missing boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - include
Keys string[] - List of keys to filter and insert into document. Defaults to including all keys
- on
Failures string[] - Handle failures for the processor.
- prefix string
- Prefix to be added to extracted keys.
- strip
Brackets boolean - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - tag string
- Identifier for the processor.
- target
Field string - The field to insert the extracted keys into. Defaults to the root of the document.
- trim
Key string - String of characters to trim from extracted keys.
- trim
Value 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
andfield
does not exist or isnull
, 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.
- field
Split 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.
- value
Split String - Regex pattern to use for splitting the key from the value within a key-value pair.
- description String
- Description of the processor.
- exclude
Keys List<String> - List of keys to exclude from document
- if String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - include
Keys List<String> - List of keys to filter and insert into document. Defaults to including all keys
- on
Failures List<String> - Handle failures for the processor.
- prefix String
- Prefix to be added to extracted keys.
- strip
Brackets Boolean - If
true
strip brackets()
,<>
,[]
as well as quotes'
and"
from extracted values. - tag String
- Identifier for the processor.
- target
Field String - The field to insert the extracted keys into. Defaults to the root of the document.
- trim
Key String - String of characters to trim from extracted keys.
- trim
Value 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 0.11.15 published on Wednesday, Apr 23, 2025 by elastic