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

elasticstack.getElasticsearchIngestProcessorEnrich

Explore with Pulumi AI

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

    The enrich processor can enrich documents with data from another index. See enrich data section for more information about how to set this up.

    See: https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html and https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const enrich = elasticstack.getElasticsearchIngestProcessorEnrich({
        policyName: "users-policy",
        field: "email",
        targetField: "user",
        maxMatches: 1,
    });
    const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [enrich.then(enrich => enrich.json)]});
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    enrich = elasticstack.get_elasticsearch_ingest_processor_enrich(policy_name="users-policy",
        field="email",
        target_field="user",
        max_matches=1)
    my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[enrich.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 {
    		enrich, err := elasticstack.GetElasticsearchIngestProcessorEnrich(ctx, &elasticstack.GetElasticsearchIngestProcessorEnrichArgs{
    			PolicyName:  "users-policy",
    			Field:       "email",
    			TargetField: "user",
    			MaxMatches:  pulumi.Float64Ref(1),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
    			Processors: pulumi.StringArray{
    				pulumi.String(enrich.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 enrich = Elasticstack.GetElasticsearchIngestProcessorEnrich.Invoke(new()
        {
            PolicyName = "users-policy",
            Field = "email",
            TargetField = "user",
            MaxMatches = 1,
        });
    
        var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
        {
            Processors = new[]
            {
                enrich.Apply(getElasticsearchIngestProcessorEnrichResult => getElasticsearchIngestProcessorEnrichResult.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.GetElasticsearchIngestProcessorEnrichArgs;
    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 enrich = ElasticstackFunctions.getElasticsearchIngestProcessorEnrich(GetElasticsearchIngestProcessorEnrichArgs.builder()
                .policyName("users-policy")
                .field("email")
                .targetField("user")
                .maxMatches(1)
                .build());
    
            var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
                .processors(enrich.applyValue(getElasticsearchIngestProcessorEnrichResult -> getElasticsearchIngestProcessorEnrichResult.json()))
                .build());
    
        }
    }
    
    resources:
      myIngestPipeline:
        type: elasticstack:ElasticsearchIngestPipeline
        properties:
          processors:
            - ${enrich.json}
    variables:
      enrich:
        fn::invoke:
          function: elasticstack:getElasticsearchIngestProcessorEnrich
          arguments:
            policyName: users-policy
            field: email
            targetField: user
            maxMatches: 1
    

    Using getElasticsearchIngestProcessorEnrich

    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 getElasticsearchIngestProcessorEnrich(args: GetElasticsearchIngestProcessorEnrichArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorEnrichResult>
    function getElasticsearchIngestProcessorEnrichOutput(args: GetElasticsearchIngestProcessorEnrichOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorEnrichResult>
    def get_elasticsearch_ingest_processor_enrich(description: Optional[str] = None,
                                                  field: Optional[str] = None,
                                                  if_: Optional[str] = None,
                                                  ignore_failure: Optional[bool] = None,
                                                  ignore_missing: Optional[bool] = None,
                                                  max_matches: Optional[float] = None,
                                                  on_failures: Optional[Sequence[str]] = None,
                                                  override: Optional[bool] = None,
                                                  policy_name: Optional[str] = None,
                                                  shape_relation: Optional[str] = None,
                                                  tag: Optional[str] = None,
                                                  target_field: Optional[str] = None,
                                                  opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorEnrichResult
    def get_elasticsearch_ingest_processor_enrich_output(description: Optional[pulumi.Input[str]] = None,
                                                  field: 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,
                                                  max_matches: Optional[pulumi.Input[float]] = None,
                                                  on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                                  override: Optional[pulumi.Input[bool]] = None,
                                                  policy_name: Optional[pulumi.Input[str]] = None,
                                                  shape_relation: Optional[pulumi.Input[str]] = None,
                                                  tag: Optional[pulumi.Input[str]] = None,
                                                  target_field: Optional[pulumi.Input[str]] = None,
                                                  opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorEnrichResult]
    func GetElasticsearchIngestProcessorEnrich(ctx *Context, args *GetElasticsearchIngestProcessorEnrichArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorEnrichResult, error)
    func GetElasticsearchIngestProcessorEnrichOutput(ctx *Context, args *GetElasticsearchIngestProcessorEnrichOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorEnrichResultOutput

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

    public static class GetElasticsearchIngestProcessorEnrich 
    {
        public static Task<GetElasticsearchIngestProcessorEnrichResult> InvokeAsync(GetElasticsearchIngestProcessorEnrichArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchIngestProcessorEnrichResult> Invoke(GetElasticsearchIngestProcessorEnrichInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchIngestProcessorEnrichResult> getElasticsearchIngestProcessorEnrich(GetElasticsearchIngestProcessorEnrichArgs args, InvokeOptions options)
    public static Output<GetElasticsearchIngestProcessorEnrichResult> getElasticsearchIngestProcessorEnrich(GetElasticsearchIngestProcessorEnrichArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchIngestProcessorEnrich:getElasticsearchIngestProcessorEnrich
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Field string
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    PolicyName string
    The name of the enrich policy to use.
    TargetField string
    Field added to incoming documents to contain enrich data.
    Description string
    Description of the processor.
    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.
    MaxMatches double
    The maximum number of matched documents to include under the configured target field.
    OnFailures List<string>
    Handle failures for the processor.
    Override bool
    If processor will update fields with pre-existing non-null-valued field.
    ShapeRelation string
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    Tag string
    Identifier for the processor.
    Field string
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    PolicyName string
    The name of the enrich policy to use.
    TargetField string
    Field added to incoming documents to contain enrich data.
    Description string
    Description of the processor.
    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.
    MaxMatches float64
    The maximum number of matched documents to include under the configured target field.
    OnFailures []string
    Handle failures for the processor.
    Override bool
    If processor will update fields with pre-existing non-null-valued field.
    ShapeRelation string
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    Tag string
    Identifier for the processor.
    field String
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    policyName String
    The name of the enrich policy to use.
    targetField String
    Field added to incoming documents to contain enrich data.
    description String
    Description of the processor.
    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.
    maxMatches Double
    The maximum number of matched documents to include under the configured target field.
    onFailures List<String>
    Handle failures for the processor.
    override Boolean
    If processor will update fields with pre-existing non-null-valued field.
    shapeRelation String
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag String
    Identifier for the processor.
    field string
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    policyName string
    The name of the enrich policy to use.
    targetField string
    Field added to incoming documents to contain enrich data.
    description string
    Description of the processor.
    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.
    maxMatches number
    The maximum number of matched documents to include under the configured target field.
    onFailures string[]
    Handle failures for the processor.
    override boolean
    If processor will update fields with pre-existing non-null-valued field.
    shapeRelation string
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag string
    Identifier for the processor.
    field str
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    policy_name str
    The name of the enrich policy to use.
    target_field str
    Field added to incoming documents to contain enrich data.
    description str
    Description of the processor.
    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.
    max_matches float
    The maximum number of matched documents to include under the configured target field.
    on_failures Sequence[str]
    Handle failures for the processor.
    override bool
    If processor will update fields with pre-existing non-null-valued field.
    shape_relation str
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag str
    Identifier for the processor.
    field String
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    policyName String
    The name of the enrich policy to use.
    targetField String
    Field added to incoming documents to contain enrich data.
    description String
    Description of the processor.
    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.
    maxMatches Number
    The maximum number of matched documents to include under the configured target field.
    onFailures List<String>
    Handle failures for the processor.
    override Boolean
    If processor will update fields with pre-existing non-null-valued field.
    shapeRelation String
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag String
    Identifier for the processor.

    getElasticsearchIngestProcessorEnrich Result

    The following output properties are available:

    Field string
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    Id string
    Internal identifier of the resource
    Json string
    JSON representation of this data source.
    PolicyName string
    The name of the enrich policy to use.
    TargetField string
    Field added to incoming documents to contain enrich data.
    Description string
    Description of the processor.
    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.
    MaxMatches double
    The maximum number of matched documents to include under the configured target field.
    OnFailures List<string>
    Handle failures for the processor.
    Override bool
    If processor will update fields with pre-existing non-null-valued field.
    ShapeRelation string
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    Tag string
    Identifier for the processor.
    Field string
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    Id string
    Internal identifier of the resource
    Json string
    JSON representation of this data source.
    PolicyName string
    The name of the enrich policy to use.
    TargetField string
    Field added to incoming documents to contain enrich data.
    Description string
    Description of the processor.
    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.
    MaxMatches float64
    The maximum number of matched documents to include under the configured target field.
    OnFailures []string
    Handle failures for the processor.
    Override bool
    If processor will update fields with pre-existing non-null-valued field.
    ShapeRelation string
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    Tag string
    Identifier for the processor.
    field String
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    id String
    Internal identifier of the resource
    json String
    JSON representation of this data source.
    policyName String
    The name of the enrich policy to use.
    targetField String
    Field added to incoming documents to contain enrich data.
    description String
    Description of the processor.
    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.
    maxMatches Double
    The maximum number of matched documents to include under the configured target field.
    onFailures List<String>
    Handle failures for the processor.
    override Boolean
    If processor will update fields with pre-existing non-null-valued field.
    shapeRelation String
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag String
    Identifier for the processor.
    field string
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    id string
    Internal identifier of the resource
    json string
    JSON representation of this data source.
    policyName string
    The name of the enrich policy to use.
    targetField string
    Field added to incoming documents to contain enrich data.
    description string
    Description of the processor.
    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.
    maxMatches number
    The maximum number of matched documents to include under the configured target field.
    onFailures string[]
    Handle failures for the processor.
    override boolean
    If processor will update fields with pre-existing non-null-valued field.
    shapeRelation string
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag string
    Identifier for the processor.
    field str
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    id str
    Internal identifier of the resource
    json str
    JSON representation of this data source.
    policy_name str
    The name of the enrich policy to use.
    target_field str
    Field added to incoming documents to contain enrich data.
    description str
    Description of the processor.
    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.
    max_matches float
    The maximum number of matched documents to include under the configured target field.
    on_failures Sequence[str]
    Handle failures for the processor.
    override bool
    If processor will update fields with pre-existing non-null-valued field.
    shape_relation str
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag str
    Identifier for the processor.
    field String
    The field in the input document that matches the policies match_field used to retrieve the enrichment data.
    id String
    Internal identifier of the resource
    json String
    JSON representation of this data source.
    policyName String
    The name of the enrich policy to use.
    targetField String
    Field added to incoming documents to contain enrich data.
    description String
    Description of the processor.
    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.
    maxMatches Number
    The maximum number of matched documents to include under the configured target field.
    onFailures List<String>
    Handle failures for the processor.
    override Boolean
    If processor will update fields with pre-existing non-null-valued field.
    shapeRelation String
    A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.
    tag String
    Identifier for the processor.

    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