File: option_name.md

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 (125 lines) | stat: -rw-r--r-- 3,920 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
mapped_pages:
  - https://www.elastic.co/guide/en/elasticsearch/client/curator/current/option_name.html
---

# name [option_name]

::::{note}
This setting is used by the [alias](/reference/alias.md), [create_index](/reference/create_index.md) and [snapshot](/reference/snapshot.md), actions.
::::


The value of this setting is the name of the alias, snapshot, or index, depending on which action makes use of `name`.

## date math [_date_math_2]

This setting may be a valid [Elasticsearch date math string](http://www.elastic.co/guide/en/elasticsearch/reference/8.15/api-conventions.md#api-date-math-index-names).

A date math name takes the following form:

```sh
<static_name{date_math_expr{date_format|time_zone}}>
```

|     |     |
| --- | --- |
| `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.

| 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&#124;+12:00}}>` | `logstash-2024.03.23` |


## strftime [_strftime]

This setting may alternately contain a valid Python strftime string.  Curator will extract the strftime identifiers and replace them with the corresponding values.

The identifiers that Curator currently recognizes include:

| Unit | Value |
| --- | --- |
| `%Y` | 4 digit year |
| `%y` | 2 digit year |
| `%m` | 2 digit month |
| `%W` | 2 digit week of the year |
| `%d` | 2 digit day of the month |
| `%H` | 2 digit hour of the day, in 24 hour notation |
| `%M` | 2 digit minute of the hour |
| `%S` | 2 digit second of the minute |
| `%j` | 3 digit day of the year |


## [alias](/reference/alias.md) [_alias/curator/docs/reference/elasticsearch/elasticsearch-client-curator/alias.md_2]

```yaml
action: alias
description: "Add/Remove selected indices to or from the specified alias"
options:
  name: alias_name
add:
  filters:
  - filtertype: ...
remove:
  filters:
  - filtertype: ...
```

This option is required by the [alias](/reference/alias.md) action, and has no default setting in that context.


## [create_index](/reference/create_index.md) [_create_index/curator/docs/reference/elasticsearch/elasticsearch-client-curator/create_index.md_2]

For the [create_index](/reference/create_index.md) action, there is no default setting, but you can use strftime:

```yaml
action: create_index
description: "Create index as named"
options:
  name: 'myindex-%Y.%m'
  # ...
```

or use Elasticsearch [date math](http://www.elastic.co/guide/en/elasticsearch/reference/8.15/api-conventions.md#api-date-math-index-names)

```yaml
action: create_index
description: "Create index as named"
options:
  name: '<logstash-{now/d+1d}>'
  # ...
```

to name your indices.  See more in the [create_index](/reference/create_index.md) documenation.


## [snapshot](/reference/snapshot.md) [_snapshot/curator/docs/reference/elasticsearch/elasticsearch-client-curator/snapshot.md_4]

```yaml
action: snapshot
description: >-
  Snapshot selected indices to 'repository' with the snapshot name or name
  pattern in 'name'.  Use all other options as assigned
options:
  repository: my_repository
  name:
  include_global_state: True
  wait_for_completion: True
  max_wait: 3600
  wait_interval: 10
filters:
- filtertype: ...
```

For the [snapshot](/reference/snapshot.md) action, the default value of this setting is `curator-%Y%m%d%H%M%S`