elasticstack.getElasticsearchIngestProcessorGsub
Explore with Pulumi AI
Converts a string field by applying a regular expression and a replacement. If the field is an array of string, all members of the array will be converted. If any non-string values are encountered, the processor will throw an exception.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/gsub-processor.html
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";
const gsub = elasticstack.getElasticsearchIngestProcessorGsub({
field: "field1",
pattern: "\\.",
replacement: "-",
});
const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [gsub.then(gsub => gsub.json)]});
import pulumi
import pulumi_elasticstack as elasticstack
gsub = elasticstack.get_elasticsearch_ingest_processor_gsub(field="field1",
pattern="\\.",
replacement="-")
my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[gsub.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 {
gsub, err := elasticstack.GetElasticsearchIngestProcessorGsub(ctx, &elasticstack.GetElasticsearchIngestProcessorGsubArgs{
Field: "field1",
Pattern: "\\.",
Replacement: "-",
}, nil)
if err != nil {
return err
}
_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
Processors: pulumi.StringArray{
pulumi.String(gsub.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 gsub = Elasticstack.GetElasticsearchIngestProcessorGsub.Invoke(new()
{
Field = "field1",
Pattern = "\\.",
Replacement = "-",
});
var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
{
Processors = new[]
{
gsub.Apply(getElasticsearchIngestProcessorGsubResult => getElasticsearchIngestProcessorGsubResult.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.GetElasticsearchIngestProcessorGsubArgs;
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 gsub = ElasticstackFunctions.getElasticsearchIngestProcessorGsub(GetElasticsearchIngestProcessorGsubArgs.builder()
.field("field1")
.pattern("\\.")
.replacement("-")
.build());
var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
.processors(gsub.applyValue(getElasticsearchIngestProcessorGsubResult -> getElasticsearchIngestProcessorGsubResult.json()))
.build());
}
}
resources:
myIngestPipeline:
type: elasticstack:ElasticsearchIngestPipeline
properties:
processors:
- ${gsub.json}
variables:
gsub:
fn::invoke:
function: elasticstack:getElasticsearchIngestProcessorGsub
arguments:
field: field1
pattern: \.
replacement: '-'
Using getElasticsearchIngestProcessorGsub
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 getElasticsearchIngestProcessorGsub(args: GetElasticsearchIngestProcessorGsubArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorGsubResult>
function getElasticsearchIngestProcessorGsubOutput(args: GetElasticsearchIngestProcessorGsubOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorGsubResult>
def get_elasticsearch_ingest_processor_gsub(description: Optional[str] = None,
field: Optional[str] = None,
if_: Optional[str] = None,
ignore_failure: Optional[bool] = None,
ignore_missing: Optional[bool] = None,
on_failures: Optional[Sequence[str]] = None,
pattern: Optional[str] = None,
replacement: Optional[str] = None,
tag: Optional[str] = None,
target_field: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorGsubResult
def get_elasticsearch_ingest_processor_gsub_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,
on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
pattern: Optional[pulumi.Input[str]] = None,
replacement: Optional[pulumi.Input[str]] = None,
tag: Optional[pulumi.Input[str]] = None,
target_field: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorGsubResult]
func GetElasticsearchIngestProcessorGsub(ctx *Context, args *GetElasticsearchIngestProcessorGsubArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorGsubResult, error)
func GetElasticsearchIngestProcessorGsubOutput(ctx *Context, args *GetElasticsearchIngestProcessorGsubOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorGsubResultOutput
> Note: This function is named GetElasticsearchIngestProcessorGsub
in the Go SDK.
public static class GetElasticsearchIngestProcessorGsub
{
public static Task<GetElasticsearchIngestProcessorGsubResult> InvokeAsync(GetElasticsearchIngestProcessorGsubArgs args, InvokeOptions? opts = null)
public static Output<GetElasticsearchIngestProcessorGsubResult> Invoke(GetElasticsearchIngestProcessorGsubInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetElasticsearchIngestProcessorGsubResult> getElasticsearchIngestProcessorGsub(GetElasticsearchIngestProcessorGsubArgs args, InvokeOptions options)
public static Output<GetElasticsearchIngestProcessorGsubResult> getElasticsearchIngestProcessorGsub(GetElasticsearchIngestProcessorGsubArgs args, InvokeOptions options)
fn::invoke:
function: elasticstack:index/getElasticsearchIngestProcessorGsub:getElasticsearchIngestProcessorGsub
arguments:
# arguments dictionary
The following arguments are supported:
- Field string
- The field to apply the replacement to.
- Pattern string
- The pattern to be replaced.
- Replacement string
- The string to replace the matching patterns with.
- Description string
- Description of the processor.
- 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. - On
Failures List<string> - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- Target
Field string - The field to assign the converted value to, by default
field
is updated in-place.
- Field string
- The field to apply the replacement to.
- Pattern string
- The pattern to be replaced.
- Replacement string
- The string to replace the matching patterns with.
- Description string
- Description of the processor.
- 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. - On
Failures []string - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- Target
Field string - The field to assign the converted value to, by default
field
is updated in-place.
- field String
- The field to apply the replacement to.
- pattern String
- The pattern to be replaced.
- replacement String
- The string to replace the matching patterns with.
- description String
- Description of the processor.
- 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. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
- target
Field String - The field to assign the converted value to, by default
field
is updated in-place.
- field string
- The field to apply the replacement to.
- pattern string
- The pattern to be replaced.
- replacement string
- The string to replace the matching patterns with.
- description string
- Description of the processor.
- 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. - on
Failures string[] - Handle failures for the processor.
- tag string
- Identifier for the processor.
- target
Field string - The field to assign the converted value to, by default
field
is updated in-place.
- field str
- The field to apply the replacement to.
- pattern str
- The pattern to be replaced.
- replacement str
- The string to replace the matching patterns with.
- 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
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - on_
failures Sequence[str] - Handle failures for the processor.
- tag str
- Identifier for the processor.
- target_
field str - The field to assign the converted value to, by default
field
is updated in-place.
- field String
- The field to apply the replacement to.
- pattern String
- The pattern to be replaced.
- replacement String
- The string to replace the matching patterns with.
- description String
- Description of the processor.
- 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. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
- target
Field String - The field to assign the converted value to, by default
field
is updated in-place.
getElasticsearchIngestProcessorGsub Result
The following output properties are available:
- Field string
- The field to apply the replacement to.
- Id string
- Internal identifier of the resource.
- Json string
- JSON representation of this data source.
- Pattern string
- The pattern to be replaced.
- Replacement string
- The string to replace the matching patterns with.
- Description string
- Description of the processor.
- 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. - On
Failures List<string> - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- Target
Field string - The field to assign the converted value to, by default
field
is updated in-place.
- Field string
- The field to apply the replacement to.
- Id string
- Internal identifier of the resource.
- Json string
- JSON representation of this data source.
- Pattern string
- The pattern to be replaced.
- Replacement string
- The string to replace the matching patterns with.
- Description string
- Description of the processor.
- 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. - On
Failures []string - Handle failures for the processor.
- Tag string
- Identifier for the processor.
- Target
Field string - The field to assign the converted value to, by default
field
is updated in-place.
- field String
- The field to apply the replacement to.
- id String
- Internal identifier of the resource.
- json String
- JSON representation of this data source.
- pattern String
- The pattern to be replaced.
- replacement String
- The string to replace the matching patterns with.
- description String
- Description of the processor.
- 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. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
- target
Field String - The field to assign the converted value to, by default
field
is updated in-place.
- field string
- The field to apply the replacement to.
- id string
- Internal identifier of the resource.
- json string
- JSON representation of this data source.
- pattern string
- The pattern to be replaced.
- replacement string
- The string to replace the matching patterns with.
- description string
- Description of the processor.
- 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. - on
Failures string[] - Handle failures for the processor.
- tag string
- Identifier for the processor.
- target
Field string - The field to assign the converted value to, by default
field
is updated in-place.
- field str
- The field to apply the replacement to.
- id str
- Internal identifier of the resource.
- json str
- JSON representation of this data source.
- pattern str
- The pattern to be replaced.
- replacement str
- The string to replace the matching patterns with.
- 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
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - on_
failures Sequence[str] - Handle failures for the processor.
- tag str
- Identifier for the processor.
- target_
field str - The field to assign the converted value to, by default
field
is updated in-place.
- field String
- The field to apply the replacement to.
- id String
- Internal identifier of the resource.
- json String
- JSON representation of this data source.
- pattern String
- The pattern to be replaced.
- replacement String
- The string to replace the matching patterns with.
- description String
- Description of the processor.
- 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. - on
Failures List<String> - Handle failures for the processor.
- tag String
- Identifier for the processor.
- target
Field String - The field to assign the converted 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.