# Add date to each new created entry in Elasticsearch

**URL:** https://discuss.elastic.co/t/add-date-to-each-new-created-entry-in-elasticsearch/49860
**Category:** Elasticsearch
**Created:** [May 12, 2016, 7:34am UTC](https://discuss.elastic.co/t/add-date-to-each-new-created-entry-in-elasticsearch/49860 "2016-05-12T07:34:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nateuni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nateuni/32/8512_2.png) [@nateuni](https://discuss.elastic.co/u/nateuni)
#### Post date: [May 12, 2016, 7:34am UTC](https://discuss.elastic.co/t/add-date-to-each-new-created-entry-in-elasticsearch/49860/1 "2016-05-12T07:34:54Z")

</div>

I read [this](https://discuss.elastic.co/t/timestamp/4529) post, but the timestamp is depreciated. And I am still not fully up to speed on what to do.

I have Logstash passing logs to ES with ES's _Dynamic Field Mapping_ (I believe this is the correct terminology). But I still don't know how to add the date index on creation, even after considerable reading. I have tried to ask in irc, but get a comment here and a comment there and for someone that is new to this topic, there is little help to be found, so I am trying here.

My unsuccessful final attempt was:

```
curl -XPUT localhost:9200/_template/my_template -d '
{
    "template" : "log*",
		"mappings": {
		    "type1": {
		      "properties": {
		        "created_at": {
		          "type": "date",
		          "format": "yyyyMMdd'T'HHmmss.SSSZ"
		        }
		      }
		    }
		}
}'

```

I deleted the logstash dynamic template, so it would start again, but nothing has changed!

Can some please assist, so I can make some ground? Thanks in advance.

---

<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:52pm UTC](https://discuss.elastic.co/t/add-date-to-each-new-created-entry-in-elasticsearch/49860/2 "2017-07-05T22:52:12Z")

</div>


