1. Packages
  2. Packages
  3. Elasticstack Provider
  4. API Docs
  5. getElasticsearchIngestProcessorSort
Viewing docs for elasticstack 0.15.0
published on Thursday, May 14, 2026 by elastic
Viewing docs for elasticstack 0.15.0
published on Thursday, May 14, 2026 by elastic

    Helper data source which can be used to create the configuration for a sort processor. This processor sorts the elements of an array ascending or descending. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-processor.html

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const sort = elasticstack.getElasticsearchIngestProcessorSort({
        field: "array_field_to_sort",
        order: "desc",
    });
    const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("my_ingest_pipeline", {
        name: "sort-ingest",
        processors: [sort.then(sort => sort.json)],
    });
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    sort = elasticstack.get_elasticsearch_ingest_processor_sort(field="array_field_to_sort",
        order="desc")
    my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("my_ingest_pipeline",
        name="sort-ingest",
        processors=[sort.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 {
    		sort, err := elasticstack.GetElasticsearchIngestProcessorSort(ctx, &elasticstack.GetElasticsearchIngestProcessorSortArgs{
    			Field: "array_field_to_sort",
    			Order: pulumi.StringRef("desc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "my_ingest_pipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
    			Name: pulumi.String("sort-ingest"),
    			Processors: pulumi.StringArray{
    				pulumi.String(sort.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 sort = Elasticstack.GetElasticsearchIngestProcessorSort.Invoke(new()
        {
            Field = "array_field_to_sort",
            Order = "desc",
        });
    
        var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("my_ingest_pipeline", new()
        {
            Name = "sort-ingest",
            Processors = new[]
            {
                sort.Apply(getElasticsearchIngestProcessorSortResult => getElasticsearchIngestProcessorSortResult.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.GetElasticsearchIngestProcessorSortArgs;
    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 sort = ElasticstackFunctions.getElasticsearchIngestProcessorSort(GetElasticsearchIngestProcessorSortArgs.builder()
                .field("array_field_to_sort")
                .order("desc")
                .build());
    
            var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
                .name("sort-ingest")
                .processors(sort.json())
                .build());
    
        }
    }
    
    resources:
      myIngestPipeline:
        type: elasticstack:ElasticsearchIngestPipeline
        name: my_ingest_pipeline
        properties:
          name: sort-ingest
          processors:
            - ${sort.json}
    variables:
      sort:
        fn::invoke:
          function: elasticstack:getElasticsearchIngestProcessorSort
          arguments:
            field: array_field_to_sort
            order: desc
    
    Example coming soon!
    

    Using getElasticsearchIngestProcessorSort

    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 getElasticsearchIngestProcessorSort(args: GetElasticsearchIngestProcessorSortArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorSortResult>
    function getElasticsearchIngestProcessorSortOutput(args: GetElasticsearchIngestProcessorSortOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorSortResult>
    def get_elasticsearch_ingest_processor_sort(description: Optional[str] = None,
                                                field: Optional[str] = None,
                                                if_: Optional[str] = None,
                                                ignore_failure: Optional[bool] = None,
                                                on_failures: Optional[Sequence[str]] = None,
                                                order: Optional[str] = None,
                                                tag: Optional[str] = None,
                                                target_field: Optional[str] = None,
                                                opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorSortResult
    def get_elasticsearch_ingest_processor_sort_output(description: pulumi.Input[Optional[str]] = None,
                                                field: pulumi.Input[Optional[str]] = None,
                                                if_: pulumi.Input[Optional[str]] = None,
                                                ignore_failure: pulumi.Input[Optional[bool]] = None,
                                                on_failures: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                                                order: pulumi.Input[Optional[str]] = None,
                                                tag: pulumi.Input[Optional[str]] = None,
                                                target_field: pulumi.Input[Optional[str]] = None,
                                                opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorSortResult]
    func GetElasticsearchIngestProcessorSort(ctx *Context, args *GetElasticsearchIngestProcessorSortArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorSortResult, error)
    func GetElasticsearchIngestProcessorSortOutput(ctx *Context, args *GetElasticsearchIngestProcessorSortOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorSortResultOutput

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

    public static class GetElasticsearchIngestProcessorSort 
    {
        public static Task<GetElasticsearchIngestProcessorSortResult> InvokeAsync(GetElasticsearchIngestProcessorSortArgs args, InvokeOptions? opts = null)
        public static Output<GetElasticsearchIngestProcessorSortResult> Invoke(GetElasticsearchIngestProcessorSortInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetElasticsearchIngestProcessorSortResult> getElasticsearchIngestProcessorSort(GetElasticsearchIngestProcessorSortArgs args, InvokeOptions options)
    public static Output<GetElasticsearchIngestProcessorSortResult> getElasticsearchIngestProcessorSort(GetElasticsearchIngestProcessorSortArgs args, InvokeOptions options)
    
    fn::invoke:
      function: elasticstack:index/getElasticsearchIngestProcessorSort:getElasticsearchIngestProcessorSort
      arguments:
        # arguments dictionary
    data "elasticstack_getelasticsearchingestprocessorsort" "name" {
        # arguments
    }

    The following arguments are supported:

    Field string
    The field to be sorted
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    OnFailures List<string>
    Handle failures for the processor.
    Order string
    The sort order to use. Accepts asc or desc.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to assign the sorted value to, by default field is updated in-place
    Field string
    The field to be sorted
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    IgnoreFailure bool
    Ignore failures for the processor.
    OnFailures []string
    Handle failures for the processor.
    Order string
    The sort order to use. Accepts asc or desc.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to assign the sorted value to, by default field is updated in-place
    field string
    The field to be sorted
    description string
    Description of the processor.
    if string
    Conditionally execute the processor
    ignore_failure bool
    Ignore failures for the processor.
    on_failures list(string)
    Handle failures for the processor.
    order string
    The sort order to use. Accepts asc or desc.
    tag string
    Identifier for the processor.
    target_field string
    The field to assign the sorted value to, by default field is updated in-place
    field String
    The field to be sorted
    description String
    Description of the processor.
    if_ String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    onFailures List<String>
    Handle failures for the processor.
    order String
    The sort order to use. Accepts asc or desc.
    tag String
    Identifier for the processor.
    targetField String
    The field to assign the sorted value to, by default field is updated in-place
    field string
    The field to be sorted
    description string
    Description of the processor.
    if string
    Conditionally execute the processor
    ignoreFailure boolean
    Ignore failures for the processor.
    onFailures string[]
    Handle failures for the processor.
    order string
    The sort order to use. Accepts asc or desc.
    tag string
    Identifier for the processor.
    targetField string
    The field to assign the sorted value to, by default field is updated in-place
    field str
    The field to be sorted
    description str
    Description of the processor.
    if_ str
    Conditionally execute the processor
    ignore_failure bool
    Ignore failures for the processor.
    on_failures Sequence[str]
    Handle failures for the processor.
    order str
    The sort order to use. Accepts asc or desc.
    tag str
    Identifier for the processor.
    target_field str
    The field to assign the sorted value to, by default field is updated in-place
    field String
    The field to be sorted
    description String
    Description of the processor.
    if String
    Conditionally execute the processor
    ignoreFailure Boolean
    Ignore failures for the processor.
    onFailures List<String>
    Handle failures for the processor.
    order String
    The sort order to use. Accepts asc or desc.
    tag String
    Identifier for the processor.
    targetField String
    The field to assign the sorted value to, by default field is updated in-place

    getElasticsearchIngestProcessorSort Result

    The following output properties are available:

    Field string
    The field to be sorted
    Id string
    Internal identifier of the resource
    IgnoreFailure bool
    Ignore failures for the processor.
    Json string
    JSON representation of this data source.
    Order string
    The sort order to use. Accepts asc or desc.
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    OnFailures List<string>
    Handle failures for the processor.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to assign the sorted value to, by default field is updated in-place
    Field string
    The field to be sorted
    Id string
    Internal identifier of the resource
    IgnoreFailure bool
    Ignore failures for the processor.
    Json string
    JSON representation of this data source.
    Order string
    The sort order to use. Accepts asc or desc.
    Description string
    Description of the processor.
    If string
    Conditionally execute the processor
    OnFailures []string
    Handle failures for the processor.
    Tag string
    Identifier for the processor.
    TargetField string
    The field to assign the sorted value to, by default field is updated in-place
    field string
    The field to be sorted
    id string
    Internal identifier of the resource
    ignore_failure bool
    Ignore failures for the processor.
    json string
    JSON representation of this data source.
    order string
    The sort order to use. Accepts asc or desc.
    description string
    Description of the processor.
    if string
    Conditionally execute the processor
    on_failures list(string)
    Handle failures for the processor.
    tag string
    Identifier for the processor.
    target_field string
    The field to assign the sorted value to, by default field is updated in-place
    field String
    The field to be sorted
    id String
    Internal identifier of the resource
    ignoreFailure Boolean
    Ignore failures for the processor.
    json String
    JSON representation of this data source.
    order String
    The sort order to use. Accepts asc or desc.
    description String
    Description of the processor.
    if_ String
    Conditionally execute the processor
    onFailures List<String>
    Handle failures for the processor.
    tag String
    Identifier for the processor.
    targetField String
    The field to assign the sorted value to, by default field is updated in-place
    field string
    The field to be sorted
    id string
    Internal identifier of the resource
    ignoreFailure boolean
    Ignore failures for the processor.
    json string
    JSON representation of this data source.
    order string
    The sort order to use. Accepts asc or desc.
    description string
    Description of the processor.
    if string
    Conditionally execute the processor
    onFailures string[]
    Handle failures for the processor.
    tag string
    Identifier for the processor.
    targetField string
    The field to assign the sorted value to, by default field is updated in-place
    field str
    The field to be sorted
    id str
    Internal identifier of the resource
    ignore_failure bool
    Ignore failures for the processor.
    json str
    JSON representation of this data source.
    order str
    The sort order to use. Accepts asc or desc.
    description str
    Description of the processor.
    if_ str
    Conditionally execute the processor
    on_failures Sequence[str]
    Handle failures for the processor.
    tag str
    Identifier for the processor.
    target_field str
    The field to assign the sorted value to, by default field is updated in-place
    field String
    The field to be sorted
    id String
    Internal identifier of the resource
    ignoreFailure Boolean
    Ignore failures for the processor.
    json String
    JSON representation of this data source.
    order String
    The sort order to use. Accepts asc or desc.
    description String
    Description of the processor.
    if String
    Conditionally execute the processor
    onFailures List<String>
    Handle failures for the processor.
    tag String
    Identifier for the processor.
    targetField String
    The field to assign the sorted value to, by default field is updated in-place

    Package Details

    Repository
    elasticstack elastic/terraform-provider-elasticstack
    License
    Notes
    This Pulumi package is based on the elasticstack Terraform Provider.
    Viewing docs for elasticstack 0.15.0
    published on Thursday, May 14, 2026 by elastic
      Try Pulumi Cloud free. Your team will thank you.