Date Index
Synopsis
Creates dynamic index names based on date fields in documents by combining a configurable prefix with formatted dates.
Schema
- date_index:
field: <ident>
date_rounding: <enum>
date_formats: <string[]>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
index_name_format: <string>
index_name_prefix: <string>
locale: <string>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
time_zone: <string>
Configuration
The following fields are used to define the processor:
| Field | Required | Default | Description |
|---|---|---|---|
field | Y | - | Field containing the date/timestamp to process |
date_rounding | Y | - | Time unit to round to: y (year), M (month), w (week), d (day), h (hour), m (minute), s (second) |
date_formats | N | [RFC3339] | Array of date format patterns to try when parsing the date field |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if parsing fails |
ignore_missing | N | false | Skip if the date field is missing |
index_name_format | N | 2006-01-02 | Go time format pattern for the output date |
index_name_prefix | N | - | String to prepend to the formatted date |
locale | N | - | Locale for date parsing |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
time_zone | N | UTC | Timezone for date parsing |