elasticstack.getElasticsearchIngestProcessorAppend
Explore with Pulumi AI
Helper data source to which can be used to create a processor to append one or more values to an existing array if the field already exists and it is an array. Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";
const tags = elasticstack.getElasticsearchIngestProcessorAppend({
field: "tags",
values: [
"production",
"{{{app}}}",
"{{{owner}}}",
],
});
const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [tags.then(tags => tags.json)]});
import pulumi
import pulumi_elasticstack as elasticstack
tags = elasticstack.get_elasticsearch_ingest_processor_append(field="tags",
values=[
"production",
"{{{app}}}",
"{{{owner}}}",
])
my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[tags.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 {
tags, err := elasticstack.GetElasticsearchIngestProcessorAppend(ctx, &elasticstack.GetElasticsearchIngestProcessorAppendArgs{
Field: "tags",
Values: []string{
"production",
"{{{app}}}",
"{{{owner}}}",
},
}, nil)
if err != nil {
return err
}
_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
Processors: pulumi.StringArray{
pulumi.String(tags.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 tags = Elasticstack.GetElasticsearchIngestProcessorAppend.Invoke(new()
{
Field = "tags",
Values = new[]
{
"production",
"{{{app}}}",
"{{{owner}}}",
},
});
var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
{
Processors = new[]
{
tags.Apply(getElasticsearchIngestProcessorAppendResult => getElasticsearchIngestProcessorAppendResult.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.GetElasticsearchIngestProcessorAppendArgs;
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 tags = ElasticstackFunctions.getElasticsearchIngestProcessorAppend(GetElasticsearchIngestProcessorAppendArgs.builder()
.field("tags")
.values(
"production",
"{{{app}}}",
"{{{owner}}}")
.build());
var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
.processors(tags.applyValue(getElasticsearchIngestProcessorAppendResult -> getElasticsearchIngestProcessorAppendResult.json()))
.build());
}
}
resources:
myIngestPipeline:
type: elasticstack:ElasticsearchIngestPipeline
properties:
processors:
- ${tags.json}
variables:
tags:
fn::invoke:
function: elasticstack:getElasticsearchIngestProcessorAppend
arguments:
field: tags
values:
- production
- '{{{app}}}'
- '{{{owner}}}'
Using getElasticsearchIngestProcessorAppend
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 getElasticsearchIngestProcessorAppend(args: GetElasticsearchIngestProcessorAppendArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorAppendResult>
function getElasticsearchIngestProcessorAppendOutput(args: GetElasticsearchIngestProcessorAppendOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorAppendResult>
def get_elasticsearch_ingest_processor_append(allow_duplicates: Optional[bool] = None,
description: Optional[str] = None,
field: Optional[str] = None,
if_: Optional[str] = None,
ignore_failure: Optional[bool] = None,
media_type: Optional[str] = None,
on_failures: Optional[Sequence[str]] = None,
tag: Optional[str] = None,
values: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorAppendResult
def get_elasticsearch_ingest_processor_append_output(allow_duplicates: Optional[pulumi.Input[bool]] = None,
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,
media_type: Optional[pulumi.Input[str]] = None,
on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
tag: Optional[pulumi.Input[str]] = None,
values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorAppendResult]
func GetElasticsearchIngestProcessorAppend(ctx *Context, args *GetElasticsearchIngestProcessorAppendArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorAppendResult, error)
func GetElasticsearchIngestProcessorAppendOutput(ctx *Context, args *GetElasticsearchIngestProcessorAppendOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorAppendResultOutput
> Note: This function is named GetElasticsearchIngestProcessorAppend
in the Go SDK.
public static class GetElasticsearchIngestProcessorAppend
{
public static Task<GetElasticsearchIngestProcessorAppendResult> InvokeAsync(GetElasticsearchIngestProcessorAppendArgs args, InvokeOptions? opts = null)
public static Output<GetElasticsearchIngestProcessorAppendResult> Invoke(GetElasticsearchIngestProcessorAppendInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetElasticsearchIngestProcessorAppendResult> getElasticsearchIngestProcessorAppend(GetElasticsearchIngestProcessorAppendArgs args, InvokeOptions options)
public static Output<GetElasticsearchIngestProcessorAppendResult> getElasticsearchIngestProcessorAppend(GetElasticsearchIngestProcessorAppendArgs args, InvokeOptions options)
fn::invoke:
function: elasticstack:index/getElasticsearchIngestProcessorAppend:getElasticsearchIngestProcessorAppend
arguments:
# arguments dictionary
The following arguments are supported:
- Field string
- The field to be appended to.
- Values List<string>
- The value to be appended.
- Allow
Duplicates bool - If
false
, the processor does not append values already present in the field. - Description string
- Description of the processor.
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Media
Type string - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - On
Failures List<string> - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- Field string
- The field to be appended to.
- Values []string
- The value to be appended.
- Allow
Duplicates bool - If
false
, the processor does not append values already present in the field. - Description string
- Description of the processor.
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Media
Type string - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - On
Failures []string - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- field String
- The field to be appended to.
- values List<String>
- The value to be appended.
- allow
Duplicates Boolean - If
false
, the processor does not append values already present in the field. - description String
- Description of the processor.
- if_ String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- media
Type String - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
- field string
- The field to be appended to.
- values string[]
- The value to be appended.
- allow
Duplicates boolean - If
false
, the processor does not append values already present in the field. - description string
- Description of the processor.
- if string
- Conditionally execute the processor
- ignore
Failure boolean - Ignore failures for the processor.
- media
Type string - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on
Failures string[] - Handle failures for the processor.
- tag string
- Identifier for the processor.
- field str
- The field to be appended to.
- values Sequence[str]
- The value to be appended.
- allow_
duplicates bool - If
false
, the processor does not append values already present in the field. - description str
- Description of the processor.
- if_ str
- Conditionally execute the processor
- ignore_
failure bool - Ignore failures for the processor.
- media_
type str - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on_
failures Sequence[str] - Handle failures for the processor.
- tag str
- Identifier for the processor.
- field String
- The field to be appended to.
- values List<String>
- The value to be appended.
- allow
Duplicates Boolean - If
false
, the processor does not append values already present in the field. - description String
- Description of the processor.
- if String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- media
Type String - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
getElasticsearchIngestProcessorAppend Result
The following output properties are available:
- Field string
- The field to be appended to.
- Id string
- Internal identifier of the resource
- Json string
- JSON representation of this data source.
- Values List<string>
- The value to be appended.
- Allow
Duplicates bool - If
false
, the processor does not append values already present in the field. - Description string
- Description of the processor.
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Media
Type string - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - On
Failures List<string> - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- Field string
- The field to be appended to.
- Id string
- Internal identifier of the resource
- Json string
- JSON representation of this data source.
- Values []string
- The value to be appended.
- Allow
Duplicates bool - If
false
, the processor does not append values already present in the field. - Description string
- Description of the processor.
- If string
- Conditionally execute the processor
- Ignore
Failure bool - Ignore failures for the processor.
- Media
Type string - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - On
Failures []string - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- field String
- The field to be appended to.
- id String
- Internal identifier of the resource
- json String
- JSON representation of this data source.
- values List<String>
- The value to be appended.
- allow
Duplicates Boolean - If
false
, the processor does not append values already present in the field. - description String
- Description of the processor.
- if_ String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- media
Type String - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
- field string
- The field to be appended to.
- id string
- Internal identifier of the resource
- json string
- JSON representation of this data source.
- values string[]
- The value to be appended.
- allow
Duplicates boolean - If
false
, the processor does not append values already present in the field. - description string
- Description of the processor.
- if string
- Conditionally execute the processor
- ignore
Failure boolean - Ignore failures for the processor.
- media
Type string - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on
Failures string[] - Handle failures for the processor.
- tag string
- Identifier for the processor.
- field str
- The field to be appended to.
- id str
- Internal identifier of the resource
- json str
- JSON representation of this data source.
- values Sequence[str]
- The value to be appended.
- allow_
duplicates bool - If
false
, the processor does not append values already present in the field. - description str
- Description of the processor.
- if_ str
- Conditionally execute the processor
- ignore_
failure bool - Ignore failures for the processor.
- media_
type str - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on_
failures Sequence[str] - Handle failures for the processor.
- tag str
- Identifier for the processor.
- field String
- The field to be appended to.
- id String
- Internal identifier of the resource
- json String
- JSON representation of this data source.
- values List<String>
- The value to be appended.
- allow
Duplicates Boolean - If
false
, the processor does not append values already present in the field. - description String
- Description of the processor.
- if String
- Conditionally execute the processor
- ignore
Failure Boolean - Ignore failures for the processor.
- media
Type String - The media type for encoding value. Applies only when value is a template snippet. Must be one of
application/json
,text/plain
, orapplication/x-www-form-urlencoded
. Supported only from Elasticsearch version 7.15. - on
Failures List<String> - Handle failures for the processor.
- 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.