File: inc_datemath.asciidoc

package info (click to toggle)
elasticsearch-curator 8.0.21-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,716 kB
  • sloc: python: 17,838; makefile: 159; sh: 156
file content (28 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
This setting may be a valid {ref}/api-conventions.html#api-date-math-index-names[Elasticsearch date math string].

A date math name takes the following form:

[source,sh]
-------------
<static_name{date_math_expr{date_format|time_zone}}>
-------------

[width="50%", cols="<m,"]
|===
|static_name| is the static text part of the name
|date_math_expr| is a dynamic date math expression that computes the date dynamically
|date_format|is the optional format in which the computed date should be rendered. Defaults to `yyyy.MM.dd`.
|time_zone|is the optional time zone . Defaults to `utc`.
|===

The following example shows different forms of date math names and the final form they resolve to given the current time is 22rd March 2024 noon utc.

[width="50%", cols="<m,m", options="header"]
|===
|Expression| Resolves to
|<logstash-{now/d}>| logstash-2024.03.22
|<logstash-{now/M}>| logstash-2024.03.01
|<logstash-{now/M{yyyy.MM}}>| logstash-2024.03
|<logstash-{now/M-1M{yyyy.MM}}>| logstash-2024.02
|<logstash-{now/d{yyyy.MM.dd\|+12:00}}> | logstash-2024.03.23
|===