# Curator timestring

**URL:** <https://discuss.elastic.co/t/curator-timestring/176131>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [April 10, 2019, 3:18am UTC](https://discuss.elastic.co/t/curator-timestring/176131 "2019-04-10T03:18:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iQIYI](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iQIYI](https://discuss.elastic.co/u/iQIYI)\
**Post date:** [April 10, 2019, 3:18am UTC](https://discuss.elastic.co/t/curator-timestring/176131/1 "2019-04-10T03:18:50Z")

</div>

Hi,  
I create a curator action file with 2 actions, and each of actions will execute for a long time. The first action create snapshot and 2nd actrion allocate the specified indices to the warm nodes.  
If the 1st action complete at the next day, the 2nd action will move the wrong indices. How can I avoid this situation?  
Both actions use the code snippet below

```auto
    filters:
    - filtertype: pattern
      kind: regex
      value: '^netflow-.*$'
    - filtertype: period
      period_type: relative
      source: name
      range_from: -1
      range_to: -1
      timestring: '%Y.%m.%d'
      unit: days

```

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [April 10, 2019, 3:32am UTC](https://discuss.elastic.co/t/curator-timestring/176131/2 "2019-04-10T03:32:57Z")

</div>

Attaching some DEBUG logs showing how the indices were include/excluded by the `period` configuration would go a long way to help diagnose this.

---

<div class="post-metadata">

**Author:** ![iQIYI](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iQIYI](https://discuss.elastic.co/u/iQIYI)\
**Post date:** [April 10, 2019, 7:05am UTC](https://discuss.elastic.co/t/curator-timestring/176131/3 "2019-04-10T07:05:27Z")

</div>

@theuntergeek I mean I want a global variable, so all the actions will match the same indices,  
For example, I start 2 snapshot actions at **Apr 9 23:59:44 UTC 2019** , I want all actions match indices ['netflow-2019.04.08', 'oa-2019.04.08'], but the 2nd action may match ['netflow-2019.04.09', 'oa-2019.04.09']

```auto
---
# 1. Create snapshot
# 2. Allocate to warm node
actions:
  0:
    action: snapshot
    description: "Snapshot for oa and netflow"
    options:
      repository: my_backup
      wait_for_completion: true
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(oa|netflow)-.*$'
    - filtertype: period
      period_type: relative
      source: name
      range_from: -1
      range_to: -1
      timestring: '%Y.%m.%d'
      unit: days

  1:
    action: snapshot
    description: "Snapshot for oa and netflow"
    options:
      repository: my_backup
      wait_for_completion: true
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(oa|netflow)-.*$'
    - filtertype: period
      period_type: relative
      source: name
      range_from: -1
      range_to: -1
      timestring: '%Y.%m.%d'
      unit: days

```

```auto
[root@test34:curator]# date -s "07:59:40"
Wed Apr 10 07:59:40 CST 2019
[root@test34:curator]# date -u
Tue Apr 9 23:59:44 UTC 2019
[root@test34:curator]# curator /etc/curator/action.yml --config /etc/curator/config.yml 
2019-04-10 07:59:48,368 INFO Preparing Action ID: 0, "snapshot"
2019-04-10 07:59:48,373 INFO Trying Action ID: 0, "snapshot": Snapshot for oa and netflow
2019-04-10 07:59:49,625 INFO Creating snapshot "curator-20190409235948" from indices: ['netflow-2019.04.08', 'oa-2019.04.08']
2019-04-10 07:59:50,971 INFO Snapshot curator-20190409235948 still in progress.
2019-04-10 08:00:00,004 INFO Snapshot curator-20190409235948 successfully completed.
2019-04-10 08:00:00,026 INFO Snapshot curator-20190409235948 successfully completed.
2019-04-10 08:00:00,026 INFO Action ID: 0, "snapshot" completed.
2019-04-10 08:00:00,026 INFO Preparing Action ID: 1, "snapshot"
2019-04-10 08:00:00,037 INFO Trying Action ID: 1, "snapshot": Snapshot for oa and netflow
2019-04-10 08:00:00,404 INFO Creating snapshot "curator-20190410000000" from indices: ['netflow-2019.04.09', 'oa-2019.04.09']
2019-04-10 08:00:01,439 INFO Snapshot curator-20190410000000 still in progress.
2019-04-10 08:00:10,471 INFO Snapshot curator-20190410000000 successfully completed.
2019-04-10 08:00:10,493 INFO Snapshot curator-20190410000000 successfully completed.
2019-04-10 08:00:10,493 INFO Action ID: 1, "snapshot" completed.
2019-04-10 08:00:10,494 INFO Job completed.

```

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [April 10, 2019, 11:11am UTC](https://discuss.elastic.co/t/curator-timestring/176131/4 "2019-04-10T11:11:41Z")

</div>

I see what you mean. That is a feature not coming until Curator 6, which has no target date as yet.

---

<div class="post-metadata">

**Author:** ![iQIYI](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iQIYI](https://discuss.elastic.co/u/iQIYI)\
**Post date:** [April 11, 2019, 1:23am UTC](https://discuss.elastic.co/t/curator-timestring/176131/5 "2019-04-11T01:23:05Z")

</div>

OK, Thanks for your replay

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 9, 2019, 1:23am UTC](https://discuss.elastic.co/t/curator-timestring/176131/6 "2019-05-09T01:23:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
