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

elasticstack.getElasticsearchIngestProcessorUriParts

Explore with Pulumi AI

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

    Parses a Uniform Resource Identifier (URI) string and extracts its components as an object. This URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password.

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const parts = elasticstack.getElasticsearchIngestProcessorUriParts({
        field: "input_field",
        targetField: "url",
        keepOriginal: true,
        removeIfSuccessful: false,
    });
    const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [parts.then(parts => parts.json)]});
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    parts = elasticstack.get_elasticsearch_ingest_processor_uri_parts(field="input_field",
        target_field="url",
        keep_original=True,
        remove_if_successful=False)
    my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[parts.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 {
    		parts, err := elasticstack.GetElasticsearchIngestProcessorUriParts(ctx, &elasticstack.GetElasticsearchIngestProcessorUriPartsArgs{
    			Field:              "input_field",
    			TargetField:        pulumi.StringRef("url"),
    			KeepOriginal:       pulumi.BoolRef(true),
    			RemoveIfSuccessful: pulumi.BoolRef(false),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
    			Processors: pulumi.StringArray{
    				pulumi.String(parts.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 parts = Elasticstack.GetElasticsearchIngestProcessorUriParts.Invoke(new()
        {
            Field = "input_field",
            TargetField = "url",
            KeepOriginal = true,
            RemoveIfSuccessful = false,
        });
    
        var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
        {
            Processors = new[]
            {
                parts.Apply(getElasticsearchIngestProcessorUriPartsResult => getElasticsearchIngestProcessorUriPartsResult.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.GetElasticsearchIngestProcessorUriPartsArgs;
    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 parts = ElasticstackFunctions.getElasticsearchIngestProcessorUriParts(GetElasticsearchIngestProcessorUriPartsArgs.builder()
                .field("input_field")
                .targetField("url")
                .keepOriginal(true)
                .removeIfSuccessful(false)
                .build());
    
            var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
                .processors(parts.applyValue(getElasticsearchIngestProcessorUriPartsResult -> getElasticsearchIngestProcessorUriPartsResult.json()))
                .build());
    
        }
    }
    
    resources:
      myIngestPipeline:
        type: elasticstack:ElasticsearchIngestPipeline
        properties:
          processors:
            - ${parts.json}
    variables:
      parts:
        fn::invoke:
          function: elasticstack:getElasticsearchIngestProcessorUriParts
          arguments:
            field: input_field
            targetField: url
            keepOriginal: true
            removeIfSuccessful: false
    

    Using getElasticsearchIngestProcessorUriParts

    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 getElasticsearchIngestProcessorUriParts(args: GetElasticsearchIngestProcessorUriPartsArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorUriPartsResult>
    function getElasticsearchIngestProcessorUriPartsOutput(args: GetElasticsearchIngestProcessorUriPartsOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorUriPartsResult>
    def get_elasticsearch_ingest_processor_uri_parts(description: Optional[str] = None,
                                                     field: Optional[str] = None,
                                                     if_: Optional[str] = None,
                                                     ignore_failure: Optional[bool] = None,
                                                     keep_original: Optional[bool] = None,
                                                     on_failures: Optional[Sequence[str]] = None,
                                                     remove_if_successful: Optional[bool] = None,
                                                     tag: Optional[str] = None,
                                                     target_field: Optional[str] = None,
                                                     opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorUriPartsResult
    def get_elasticsearch_ingest_processor_uri_parts_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,
                                                     keep_original: Optional[pulumi.Input[bool]] = None,
                                                     on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                                     remove_if_successful: Optional[pulumi.Input[bool]] = None,
                                                     tag: Optional[pulumi.Input[str]] = None,
                                                     target_field: Optional[pulumi.Input[str]] = None,
                                                     opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorUriPartsResult]
    func GetElasticsearchIngestProcessorUriParts(ctx *Context, args *GetElasticsearchIngestProcessorUriPartsArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorUriPartsResult, error)
    func GetElasticsearchIngestProcessorUriPartsOutput(ctx *Context, args *GetElasticsearchIngestProcessorUriPartsOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorUriPartsResultOutput

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

    public static class GetElasticsearchIngestProcessorUriParts 
    {
        public static Task<GetElasticsearchIngestProcessorUriPartsResult> InvokeAsync(GetElasticsearchIngestProcessorUriPartsArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchIngestProcessorUriPartsResult> Invoke(GetElasticsearchIngestProcessorUriPartsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchIngestProcessorUriPartsResult> getElasticsearchIngestProcessorUriParts(GetElasticsearchIngestProcessorUriPartsArgs args, InvokeOptions options)
    public static Output<GetElasticsearchIngestProcessorUriPartsResult> getElasticsearchIngestProcessorUriParts(GetElasticsearchIngestProcessorUriPartsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchIngestProcessorUriParts:getElasticsearchIngestProcessorUriParts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Field string
    Field containing the URI string.
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    KeepOriginal bool
    If true, the processor copies the unparsed URI to <target_field>.original.
    OnFailures List<string>
    Handle failures for the processor.
    RemoveIfSuccessful bool
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    Tag string
    Identifier for the processor.
    TargetField string
    Output field for the URI object.
    Field string
    Field containing the URI string.
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    KeepOriginal bool
    If true, the processor copies the unparsed URI to <target_field>.original.
    OnFailures []string
    Handle failures for the processor.
    RemoveIfSuccessful bool
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    Tag string
    Identifier for the processor.
    TargetField string
    Output field for the URI object.
    field String
    Field containing the URI string.
    description String
    Description of the processor.
    if_ String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    keepOriginal Boolean
    If true, the processor copies the unparsed URI to <target_field>.original.
    onFailures List<String>
    Handle failures for the processor.
    removeIfSuccessful Boolean
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag String
    Identifier for the processor.
    targetField String
    Output field for the URI object.
    field string
    Field containing the URI string.
    description string
    Description of the processor.
    if string
    Conditionally execute the processor
    ignoreFailure boolean
    Ignore failures for the processor.
    keepOriginal boolean
    If true, the processor copies the unparsed URI to <target_field>.original.
    onFailures string[]
    Handle failures for the processor.
    removeIfSuccessful boolean
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag string
    Identifier for the processor.
    targetField string
    Output field for the URI object.
    field str
    Field containing the URI string.
    description str
    Description of the processor.
    if_ str
    Conditionally execute the processor
    ignore_failure bool
    Ignore failures for the processor.
    keep_original bool
    If true, the processor copies the unparsed URI to <target_field>.original.
    on_failures Sequence[str]
    Handle failures for the processor.
    remove_if_successful bool
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag str
    Identifier for the processor.
    target_field str
    Output field for the URI object.
    field String
    Field containing the URI string.
    description String
    Description of the processor.
    if String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    keepOriginal Boolean
    If true, the processor copies the unparsed URI to <target_field>.original.
    onFailures List<String>
    Handle failures for the processor.
    removeIfSuccessful Boolean
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag String
    Identifier for the processor.
    targetField String
    Output field for the URI object.

    getElasticsearchIngestProcessorUriParts Result

    The following output properties are available:

    Field string
    Field containing the URI string.
    Id string
    Internal identifier of the resource.
    Json string
    JSON representation of this data source.
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    KeepOriginal bool
    If true, the processor copies the unparsed URI to <target_field>.original.
    OnFailures List<string>
    Handle failures for the processor.
    RemoveIfSuccessful bool
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    Tag string
    Identifier for the processor.
    TargetField string
    Output field for the URI object.
    Field string
    Field containing the URI string.
    Id string
    Internal identifier of the resource.
    Json string
    JSON representation of this data source.
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    KeepOriginal bool
    If true, the processor copies the unparsed URI to <target_field>.original.
    OnFailures []string
    Handle failures for the processor.
    RemoveIfSuccessful bool
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    Tag string
    Identifier for the processor.
    TargetField string
    Output field for the URI object.
    field String
    Field containing the URI string.
    id String
    Internal identifier of the resource.
    json String
    JSON representation of this data source.
    description String
    Description of the processor.
    if_ String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    keepOriginal Boolean
    If true, the processor copies the unparsed URI to <target_field>.original.
    onFailures List<String>
    Handle failures for the processor.
    removeIfSuccessful Boolean
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag String
    Identifier for the processor.
    targetField String
    Output field for the URI object.
    field string
    Field containing the URI string.
    id string
    Internal identifier of the resource.
    json string
    JSON representation of this data source.
    description string
    Description of the processor.
    if string
    Conditionally execute the processor
    ignoreFailure boolean
    Ignore failures for the processor.
    keepOriginal boolean
    If true, the processor copies the unparsed URI to <target_field>.original.
    onFailures string[]
    Handle failures for the processor.
    removeIfSuccessful boolean
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag string
    Identifier for the processor.
    targetField string
    Output field for the URI object.
    field str
    Field containing the URI string.
    id str
    Internal identifier of the resource.
    json str
    JSON representation of this data source.
    description str
    Description of the processor.
    if_ str
    Conditionally execute the processor
    ignore_failure bool
    Ignore failures for the processor.
    keep_original bool
    If true, the processor copies the unparsed URI to <target_field>.original.
    on_failures Sequence[str]
    Handle failures for the processor.
    remove_if_successful bool
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag str
    Identifier for the processor.
    target_field str
    Output field for the URI object.
    field String
    Field containing the URI string.
    id String
    Internal identifier of the resource.
    json String
    JSON representation of this data source.
    description String
    Description of the processor.
    if String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    keepOriginal Boolean
    If true, the processor copies the unparsed URI to <target_field>.original.
    onFailures List<String>
    Handle failures for the processor.
    removeIfSuccessful Boolean
    If true, the processor removes the field after parsing the URI string. If parsing fails, the processor does not remove the field.
    tag String
    Identifier for the processor.
    targetField String
    Output field for the URI object.

    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