// *** 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"; /** * The purpose of this processor is to point documents to the right time based index based on a date or timestamp field in a document by using the date math index name support. * * The processor sets the _index metadata field with a date math index name expression based on the provided index name prefix, a date or timestamp field in the documents being processed and the provided date rounding. * * First, this processor fetches the date or timestamp from a field in the document being processed. Optionally, date formatting can be configured on how the field’s value should be parsed into a date. Then this date, the provided index name prefix and the provided date rounding get formatted into a date math index name expression. Also here optionally date formatting can be specified on how the date should be formatted into a date math index name expression. * * See: https://www.elastic.co/guide/en/elasticsearch/reference/current/date-index-name-processor.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const dateIndexName = elasticstack.ElasticsearchIngestProcessorDateIndexName({ * description: "monthly date-time index naming", * field: "date1", * indexNamePrefix: "my-index-", * dateRounding: "M", * }); * const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [dateIndexName.then(dateIndexName => dateIndexName.json)]}); * ``` */ export function elasticsearchIngestProcessorDateIndexName(args: ElasticsearchIngestProcessorDateIndexNameArgs, opts?: pulumi.InvokeOptions): Promise { if (!opts) { opts = {} } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("elasticstack:index/elasticsearchIngestProcessorDateIndexName:ElasticsearchIngestProcessorDateIndexName", { "dateFormats": args.dateFormats, "dateRounding": args.dateRounding, "description": args.description, "field": args.field, "if": args.if, "ignoreFailure": args.ignoreFailure, "indexNameFormat": args.indexNameFormat, "indexNamePrefix": args.indexNamePrefix, "locale": args.locale, "onFailures": args.onFailures, "tag": args.tag, "timezone": args.timezone, }, opts); } /** * A collection of arguments for invoking ElasticsearchIngestProcessorDateIndexName. */ export interface ElasticsearchIngestProcessorDateIndexNameArgs { /** * An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. */ dateFormats?: string[]; /** * How to round the date when formatting the date into the index name. */ dateRounding: string; /** * Description of the processor. */ description?: string; /** * The field to get the date or timestamp from. */ field: string; /** * Conditionally execute the processor */ if?: string; /** * Ignore failures for the processor. */ ignoreFailure?: boolean; /** * The format to be used when printing the parsed date into the index name. */ indexNameFormat?: string; /** * A prefix of the index name to be prepended before the printed date. */ indexNamePrefix?: string; /** * The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. */ locale?: string; /** * Handle failures for the processor. */ onFailures?: string[]; /** * Identifier for the processor. */ tag?: string; /** * The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. */ timezone?: string; } /** * A collection of values returned by ElasticsearchIngestProcessorDateIndexName. */ export interface ElasticsearchIngestProcessorDateIndexNameResult { /** * An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. */ readonly dateFormats?: string[]; /** * How to round the date when formatting the date into the index name. */ readonly dateRounding: string; /** * Description of the processor. */ readonly description?: string; /** * The field to get the date or timestamp from. */ 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; /** * The format to be used when printing the parsed date into the index name. */ readonly indexNameFormat?: string; /** * A prefix of the index name to be prepended before the printed date. */ readonly indexNamePrefix?: string; /** * JSON representation of this data source. */ readonly json: string; /** * The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. */ readonly locale?: string; /** * Handle failures for the processor. */ readonly onFailures?: string[]; /** * Identifier for the processor. */ readonly tag?: string; /** * The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. */ readonly timezone?: string; } export function elasticsearchIngestProcessorDateIndexNameOutput(args: ElasticsearchIngestProcessorDateIndexNameOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply(a => elasticsearchIngestProcessorDateIndexName(a, opts)) } /** * A collection of arguments for invoking ElasticsearchIngestProcessorDateIndexName. */ export interface ElasticsearchIngestProcessorDateIndexNameOutputArgs { /** * An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. */ dateFormats?: pulumi.Input[]>; /** * How to round the date when formatting the date into the index name. */ dateRounding: pulumi.Input; /** * Description of the processor. */ description?: pulumi.Input; /** * The field to get the date or timestamp from. */ field: pulumi.Input; /** * Conditionally execute the processor */ if?: pulumi.Input; /** * Ignore failures for the processor. */ ignoreFailure?: pulumi.Input; /** * The format to be used when printing the parsed date into the index name. */ indexNameFormat?: pulumi.Input; /** * A prefix of the index name to be prepended before the printed date. */ indexNamePrefix?: pulumi.Input; /** * The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. */ locale?: pulumi.Input; /** * Handle failures for the processor. */ onFailures?: pulumi.Input[]>; /** * Identifier for the processor. */ tag?: pulumi.Input; /** * The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. */ timezone?: pulumi.Input; }