<gh_stars>0// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Elasticstack
{
    public static class GetIngestProcessorKv
    {
        /// <summary>
        /// This processor helps automatically parse messages (or specific event fields) which are of the `foo=bar` variety.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/kv-processor.html
        /// 
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var kv = Elasticstack.GetIngestProcessorKv.Invoke(new()
        ///     {
        ///         Field = "message",
        ///         FieldSplit = " ",
        ///         ValueSplit = "=",
        ///         ExcludeKeys = new[]
        ///         {
        ///             "tags",
        ///         },
        ///         Prefix = "setting_",
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             kv.Apply(getIngestProcessorKvResult =&gt; getIngestProcessorKvResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetIngestProcessorKvResult> InvokeAsync(GetIngestProcessorKvArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetIngestProcessorKvResult>("elasticstack:index/getIngestProcessorKv:getIngestProcessorKv", args ?? new GetIngestProcessorKvArgs(), options.WithDefaults());

        /// <summary>
        /// This processor helps automatically parse messages (or specific event fields) which are of the `foo=bar` variety.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/kv-processor.html
        /// 
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var kv = Elasticstack.GetIngestProcessorKv.Invoke(new()
        ///     {
        ///         Field = "message",
        ///         FieldSplit = " ",
        ///         ValueSplit = "=",
        ///         ExcludeKeys = new[]
        ///         {
        ///             "tags",
        ///         },
        ///         Prefix = "setting_",
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             kv.Apply(getIngestProcessorKvResult =&gt; getIngestProcessorKvResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetIngestProcessorKvResult> Invoke(GetIngestProcessorKvInvokeArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetIngestProcessorKvResult>("elasticstack:index/getIngestProcessorKv:getIngestProcessorKv", args ?? new GetIngestProcessorKvInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetIngestProcessorKvArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public string? Description { get; set; }

        [Input("excludeKeys")]
        private List<string>? _excludeKeys;

        /// <summary>
        /// List of keys to exclude from document
        /// </summary>
        public List<string> ExcludeKeys
        {
            get => _excludeKeys ?? (_excludeKeys = new List<string>());
            set => _excludeKeys = value;
        }

        /// <summary>
        /// The field to be parsed. Supports template snippets.
        /// </summary>
        [Input("field", required: true)]
        public string Field { get; set; } = null!;

        /// <summary>
        /// Regex pattern to use for splitting key-value pairs.
        /// </summary>
        [Input("fieldSplit", required: true)]
        public string FieldSplit { get; set; } = null!;

        /// <summary>
        /// Conditionally execute the processor
        /// </summary>
        [Input("if")]
        public string? If { get; set; }

        /// <summary>
        /// Ignore failures for the processor.
        /// </summary>
        [Input("ignoreFailure")]
        public bool? IgnoreFailure { get; set; }

        /// <summary>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        [Input("ignoreMissing")]
        public bool? IgnoreMissing { get; set; }

        [Input("includeKeys")]
        private List<string>? _includeKeys;

        /// <summary>
        /// List of keys to filter and insert into document. Defaults to including all keys
        /// </summary>
        public List<string> IncludeKeys
        {
            get => _includeKeys ?? (_includeKeys = new List<string>());
            set => _includeKeys = value;
        }

        [Input("onFailures")]
        private List<string>? _onFailures;

        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public List<string> OnFailures
        {
            get => _onFailures ?? (_onFailures = new List<string>());
            set => _onFailures = value;
        }

        /// <summary>
        /// Prefix to be added to extracted keys.
        /// </summary>
        [Input("prefix")]
        public string? Prefix { get; set; }

        /// <summary>
        /// If `true` strip brackets `()`, `&lt;&gt;`, `[]` as well as quotes `'` and `"` from extracted values.
        /// </summary>
        [Input("stripBrackets")]
        public bool? StripBrackets { get; set; }

        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        [Input("tag")]
        public string? Tag { get; set; }

        /// <summary>
        /// The field to insert the extracted keys into. Defaults to the root of the document.
        /// </summary>
        [Input("targetField")]
        public string? TargetField { get; set; }

        /// <summary>
        /// String of characters to trim from extracted keys.
        /// </summary>
        [Input("trimKey")]
        public string? TrimKey { get; set; }

        /// <summary>
        /// String of characters to trim from extracted values.
        /// </summary>
        [Input("trimValue")]
        public string? TrimValue { get; set; }

        /// <summary>
        /// Regex pattern to use for splitting the key from the value within a key-value pair.
        /// </summary>
        [Input("valueSplit", required: true)]
        public string ValueSplit { get; set; } = null!;

        public GetIngestProcessorKvArgs()
        {
        }
        public static new GetIngestProcessorKvArgs Empty => new GetIngestProcessorKvArgs();
    }

    public sealed class GetIngestProcessorKvInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("excludeKeys")]
        private InputList<string>? _excludeKeys;

        /// <summary>
        /// List of keys to exclude from document
        /// </summary>
        public InputList<string> ExcludeKeys
        {
            get => _excludeKeys ?? (_excludeKeys = new InputList<string>());
            set => _excludeKeys = value;
        }

        /// <summary>
        /// The field to be parsed. Supports template snippets.
        /// </summary>
        [Input("field", required: true)]
        public Input<string> Field { get; set; } = null!;

        /// <summary>
        /// Regex pattern to use for splitting key-value pairs.
        /// </summary>
        [Input("fieldSplit", required: true)]
        public Input<string> FieldSplit { get; set; } = null!;

        /// <summary>
        /// Conditionally execute the processor
        /// </summary>
        [Input("if")]
        public Input<string>? If { get; set; }

        /// <summary>
        /// Ignore failures for the processor.
        /// </summary>
        [Input("ignoreFailure")]
        public Input<bool>? IgnoreFailure { get; set; }

        /// <summary>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        [Input("ignoreMissing")]
        public Input<bool>? IgnoreMissing { get; set; }

        [Input("includeKeys")]
        private InputList<string>? _includeKeys;

        /// <summary>
        /// List of keys to filter and insert into document. Defaults to including all keys
        /// </summary>
        public InputList<string> IncludeKeys
        {
            get => _includeKeys ?? (_includeKeys = new InputList<string>());
            set => _includeKeys = value;
        }

        [Input("onFailures")]
        private InputList<string>? _onFailures;

        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public InputList<string> OnFailures
        {
            get => _onFailures ?? (_onFailures = new InputList<string>());
            set => _onFailures = value;
        }

        /// <summary>
        /// Prefix to be added to extracted keys.
        /// </summary>
        [Input("prefix")]
        public Input<string>? Prefix { get; set; }

        /// <summary>
        /// If `true` strip brackets `()`, `&lt;&gt;`, `[]` as well as quotes `'` and `"` from extracted values.
        /// </summary>
        [Input("stripBrackets")]
        public Input<bool>? StripBrackets { get; set; }

        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        [Input("tag")]
        public Input<string>? Tag { get; set; }

        /// <summary>
        /// The field to insert the extracted keys into. Defaults to the root of the document.
        /// </summary>
        [Input("targetField")]
        public Input<string>? TargetField { get; set; }

        /// <summary>
        /// String of characters to trim from extracted keys.
        /// </summary>
        [Input("trimKey")]
        public Input<string>? TrimKey { get; set; }

        /// <summary>
        /// String of characters to trim from extracted values.
        /// </summary>
        [Input("trimValue")]
        public Input<string>? TrimValue { get; set; }

        /// <summary>
        /// Regex pattern to use for splitting the key from the value within a key-value pair.
        /// </summary>
        [Input("valueSplit", required: true)]
        public Input<string> ValueSplit { get; set; } = null!;

        public GetIngestProcessorKvInvokeArgs()
        {
        }
        public static new GetIngestProcessorKvInvokeArgs Empty => new GetIngestProcessorKvInvokeArgs();
    }


    [OutputType]
    public sealed class GetIngestProcessorKvResult
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        public readonly string? Description;
        /// <summary>
        /// List of keys to exclude from document
        /// </summary>
        public readonly ImmutableArray<string> ExcludeKeys;
        /// <summary>
        /// The field to be parsed. Supports template snippets.
        /// </summary>
        public readonly string Field;
        /// <summary>
        /// Regex pattern to use for splitting key-value pairs.
        /// </summary>
        public readonly string FieldSplit;
        /// <summary>
        /// Internal identifier of the resource
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Conditionally execute the processor
        /// </summary>
        public readonly string? If;
        /// <summary>
        /// Ignore failures for the processor.
        /// </summary>
        public readonly bool? IgnoreFailure;
        /// <summary>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        public readonly bool? IgnoreMissing;
        /// <summary>
        /// List of keys to filter and insert into document. Defaults to including all keys
        /// </summary>
        public readonly ImmutableArray<string> IncludeKeys;
        /// <summary>
        /// JSON representation of this data source.
        /// </summary>
        public readonly string Json;
        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public readonly ImmutableArray<string> OnFailures;
        /// <summary>
        /// Prefix to be added to extracted keys.
        /// </summary>
        public readonly string? Prefix;
        /// <summary>
        /// If `true` strip brackets `()`, `&lt;&gt;`, `[]` as well as quotes `'` and `"` from extracted values.
        /// </summary>
        public readonly bool? StripBrackets;
        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        public readonly string? Tag;
        /// <summary>
        /// The field to insert the extracted keys into. Defaults to the root of the document.
        /// </summary>
        public readonly string? TargetField;
        /// <summary>
        /// String of characters to trim from extracted keys.
        /// </summary>
        public readonly string? TrimKey;
        /// <summary>
        /// String of characters to trim from extracted values.
        /// </summary>
        public readonly string? TrimValue;
        /// <summary>
        /// Regex pattern to use for splitting the key from the value within a key-value pair.
        /// </summary>
        public readonly string ValueSplit;

        [OutputConstructor]
        private GetIngestProcessorKvResult(
            string? description,

            ImmutableArray<string> excludeKeys,

            string field,

            string fieldSplit,

            string id,

            string? @if,

            bool? ignoreFailure,

            bool? ignoreMissing,

            ImmutableArray<string> includeKeys,

            string json,

            ImmutableArray<string> onFailures,

            string? prefix,

            bool? stripBrackets,

            string? tag,

            string? targetField,

            string? trimKey,

            string? trimValue,

            string valueSplit)
        {
            Description = description;
            ExcludeKeys = excludeKeys;
            Field = field;
            FieldSplit = fieldSplit;
            Id = id;
            If = @if;
            IgnoreFailure = ignoreFailure;
            IgnoreMissing = ignoreMissing;
            IncludeKeys = includeKeys;
            Json = json;
            OnFailures = onFailures;
            Prefix = prefix;
            StripBrackets = stripBrackets;
            Tag = tag;
            TargetField = targetField;
            TrimKey = trimKey;
            TrimValue = trimValue;
            ValueSplit = valueSplit;
        }
    }
}
