# ElasticSearch Date Mapping Issue

**URL:** <https://discuss.elastic.co/t/elasticsearch-date-mapping-issue/61030>\
**Category:** Elasticsearch\
**Created:** [September 20, 2016, 4:35pm UTC](https://discuss.elastic.co/t/elasticsearch-date-mapping-issue/61030 "2016-09-20T16:35:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maltman](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@maltman](https://discuss.elastic.co/u/maltman)\
**Post date:** [September 20, 2016, 4:35pm UTC](https://discuss.elastic.co/t/elasticsearch-date-mapping-issue/61030/1 "2016-09-20T16:35:48Z")

</div>

I am trying to create an index with a date mapping. I have tried a couple of different things but I get different results.

So first, here is a line from a document I am indexing:

`2016-06-14	18:12:35	1.1.1.1	GET	/origin-www.origin.com/Images/pipe-gray.png?	200	1442	0	"http://www.origin.com/Main.css"	"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"	" __qca=P0-920525163; s_fid=4CDFF16906A35CC4;__ CSCookie=z5ayStQYdIbcPTxGKyhsjRIi0peP5GAP6K; icxid=1459286804904; icxid=1459286804904; ASP.NET_SessionId=dzg3esjzp4tpg; __SessionCookie=gXA9BuDiF245ZJeuh; dtCookie=0C05828501CE759D; s_vi=[CS]v1|2A069D04051D2E2A;__CSUserIbcIDCookie=NL7VeN+rh05z5FWSCgTnzTC6G;"`

The mapping I am using for the date looks like this:

`'date': { 'type': 'date' }` or `'date': { 'type': 'date', 'format': 'YYYY-MM-DD HH:MM:SS' }`

However, I get an error message saying

"parsing exception: failed to parse [date] 2016-06-14\t18:12:35. Malformed at \t18:12:35."

I then tried to use this in my mapping

`'date': { 'type': 'date', 'format': "yyyy-MM-dd HH:mm:ss||yyyy-MM-ddTHH:mm:ss||yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-ddTHH:mm:ss.SSSZ||yyyy-MM-ddTHH:mm:ssZ" },`

The issue here is, though it indexes, it indexes as a string. That means I can't add it to Kibana as a time-field.

Can anyone help me figure out what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![maltman](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@maltman](https://discuss.elastic.co/u/maltman)\
**Post date:** [September 20, 2016, 6:32pm UTC](https://discuss.elastic.co/t/elasticsearch-date-mapping-issue/61030/2 "2016-09-20T18:32:06Z")

</div>

Convert date with strptime and strftime.

---

<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:18pm UTC](https://discuss.elastic.co/t/elasticsearch-date-mapping-issue/61030/3 "2017-07-05T22:18:43Z")

</div>


