# Weekly index with date\_index\_name processor

**URL:** <https://discuss.elastic.co/t/weekly-index-with-date-index-name-processor/233215>\
**Category:** Elasticsearch\
**Created:** [May 18, 2020, 10:56pm UTC](https://discuss.elastic.co/t/weekly-index-with-date-index-name-processor/233215 "2020-05-18T22:56:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arol](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Arol](https://discuss.elastic.co/u/Arol)\
**Post date:** [May 18, 2020, 10:56pm UTC](https://discuss.elastic.co/t/weekly-index-with-date-index-name-processor/233215/1 "2020-05-18T22:56:08Z")

</div>

I implement weakly-routing using elaticsearch processors.  
I need to generate the formy index yyyy-MM-W, i.e. for the date 05/19/2020, the index -2020-05-4 must be created.

I use the processor:

```auto
     "date_index_name" : {
          "field" : "add_time",
          "index_name_prefix" : "testtime-",
          "index_name_format":"yyyy-MM-W",
          "date_rounding" : "d",
          "date_formats":["yyyy-MM-dd HH:mm:ss.SSS"]
        }
    }

```

Test message:

```auto
PUT /testtime/_doc/10
{
    "add_time": "2020-05-19 01:41:42.303"
}

```

However, as a result, an index of type testtime-2020-05-1 is formed. For any date, the week value is 1.

As I understood from the documentation, the date format conforms to the java standard.  
Is this format not supported or am I doing something wrong?  
I understand that you can use a hack: round the date by week value and use the date format yyyy-MM-dd, in fact it will be the same, but the resulting index names do not quite correspond to reality.

---

<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:** [June 15, 2020, 10:56pm UTC](https://discuss.elastic.co/t/weekly-index-with-date-index-name-processor/233215/2 "2020-06-15T22:56:17Z")

</div>

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