// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const gsub = elasticstack.ElasticsearchIngestProcessorGsub({ * field: "field1", * pattern: "\\.", * replacement: "-", * }); * const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [gsub.then(gsub => gsub.json)]}); * ``` */ export function elasticsearchIngestProcessorGsub(args: ElasticsearchIngestProcessorGsubArgs, opts?: pulumi.InvokeOptions): Promise { if (!opts) { opts = {} } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("elasticstack:index/elasticsearchIngestProcessorGsub:ElasticsearchIngestProcessorGsub", { "description": args.description, "field": args.field, "if": args.if, "ignoreFailure": args.ignoreFailure, "ignoreMissing": args.ignoreMissing, "onFailures": args.onFailures, "pattern": args.pattern, "replacement": args.replacement, "tag": args.tag, "targetField": args.targetField, }, opts); } /** * A collection of arguments for invoking ElasticsearchIngestProcessorGsub. */ export interface ElasticsearchIngestProcessorGsubArgs { /** * Description of the processor. */ description?: string; /** * The field to apply the replacement to. */ field: string; /** * Conditionally execute the processor */ if?: string; /** * Ignore failures for the processor. */ ignoreFailure?: boolean; /** * If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. */ ignoreMissing?: boolean; /** * Handle failures for the processor. */ onFailures?: string[]; /** * The pattern to be replaced. */ pattern: string; /** * The string to replace the matching patterns with. */ replacement: string; /** * Identifier for the processor. */ tag?: string; /** * The field to assign the converted value to, by default `field` is updated in-place. */ targetField?: string; } /** * A collection of values returned by ElasticsearchIngestProcessorGsub. */ export interface ElasticsearchIngestProcessorGsubResult { /** * Description of the processor. */ readonly description?: string; /** * The field to apply the replacement to. */ readonly field: string; /** * Internal identifier of the resource. */ readonly id: string; /** * Conditionally execute the processor */ readonly if?: string; /** * Ignore failures for the processor. */ readonly ignoreFailure?: boolean; /** * If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. */ readonly ignoreMissing?: boolean; /** * JSON representation of this data source. */ readonly json: string; /** * Handle failures for the processor. */ readonly onFailures?: string[]; /** * The pattern to be replaced. */ readonly pattern: string; /** * The string to replace the matching patterns with. */ readonly replacement: string; /** * Identifier for the processor. */ readonly tag?: string; /** * The field to assign the converted value to, by default `field` is updated in-place. */ readonly targetField?: string; } export function elasticsearchIngestProcessorGsubOutput(args: ElasticsearchIngestProcessorGsubOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply(a => elasticsearchIngestProcessorGsub(a, opts)) } /** * A collection of arguments for invoking ElasticsearchIngestProcessorGsub. */ export interface ElasticsearchIngestProcessorGsubOutputArgs { /** * Description of the processor. */ description?: pulumi.Input; /** * The field to apply the replacement to. */ field: pulumi.Input; /** * Conditionally execute the processor */ if?: pulumi.Input; /** * Ignore failures for the processor. */ ignoreFailure?: pulumi.Input; /** * If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document. */ ignoreMissing?: pulumi.Input; /** * Handle failures for the processor. */ onFailures?: pulumi.Input[]>; /** * The pattern to be replaced. */ pattern: pulumi.Input; /** * The string to replace the matching patterns with. */ replacement: pulumi.Input; /** * Identifier for the processor. */ tag?: pulumi.Input; /** * The field to assign the converted value to, by default `field` is updated in-place. */ targetField?: pulumi.Input; }