# Problem creating date based index with CURL

**URL:** <https://discuss.elastic.co/t/problem-creating-date-based-index-with-curl/48970>\
**Category:** Elasticsearch\
**Created:** [May 2, 2016, 2:55pm UTC](https://discuss.elastic.co/t/problem-creating-date-based-index-with-curl/48970 "2016-05-02T14:55:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mc1392](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mc1392](https://discuss.elastic.co/u/mc1392)\
**Post date:** [May 2, 2016, 2:55pm UTC](https://discuss.elastic.co/t/problem-creating-date-based-index-with-curl/48970/1 "2016-05-02T14:55:49Z")

</div>

Trying to create a date based index with curl, using the command line.  
The command prompt does not return.

Here is what I am trying:

> curl -XPOST '[http://localhost:9200/\*\*member\_history-%{+YYYY.MM.dd}](http://localhost:9200/**member_history-%25%7B+YYYY.MM.dd%7D)\*\*' -d '{"mappings":{"ats":{"properties":{"member type":{"type":"string","index":"not\_analyzed"}}}}}'

I have no problems doing this:

> curl -XPOST '[http://localhost:9200/\*\*member\_history](http://localhost:9200/**member_history)\*\*' -d '{"mappings":{"ats":{"properties":{"member type":{"type":"string","index":"not\_analyzed"}}}}}'

CURL doesnt like this part:  
' **-%{YYYY.MM.dd}**'

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 2, 2016, 10:18pm UTC](https://discuss.elastic.co/t/problem-creating-date-based-index-with-curl/48970/2 "2016-05-02T22:18:28Z")

</div>

curl doesn't know how to convert that into a number. You need to pass in the date.

---

<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:** [July 5, 2017, 10:54pm UTC](https://discuss.elastic.co/t/problem-creating-date-based-index-with-curl/48970/3 "2017-07-05T22:54:34Z")

</div>


