# Parsing problem with custom date format(YYYY-MM-dd HH:mm:ss.S) , failing when called with bulk API

**URL:** https://discuss.elastic.co/t/parsing-problem-with-custom-date-format-yyyy-mm-dd-hh-mm-ss-s-failing-when-called-with-bulk-api/37063
**Category:** Elasticsearch
**Created:** [December 13, 2015, 2:41pm UTC](https://discuss.elastic.co/t/parsing-problem-with-custom-date-format-yyyy-mm-dd-hh-mm-ss-s-failing-when-called-with-bulk-api/37063 "2015-12-13T14:41:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Biswajit\_Pathak](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@Biswajit\_Pathak](https://discuss.elastic.co/u/Biswajit_Pathak)
#### Post date: [December 13, 2015, 2:41pm UTC](https://discuss.elastic.co/t/parsing-problem-with-custom-date-format-yyyy-mm-dd-hh-mm-ss-s-failing-when-called-with-bulk-api/37063/1 "2015-12-13T14:41:48Z")

</div>

I am trying to use bulk import after setting mapping for my index and type.

I am getting the following exception when running curl -XPOST [http://localhost:9200/\_bulk?pretty](http://localhost:9200/_bulk?pretty) --data-binary @sample.json :

.......  
},{ "index" : {  
"\_index" : "SOMEINDEX",  
"\_type" : "SOMETYPE",  
"\_id" : "2",  
"status" : 400,  
"error" : {  
"type" : "mapper\_parsing\_exception",  
"reason" : "failed to parse [customDate]",  
"caused\_by" : {  
"type" : "illegal\_argument\_exception",  
"reason" : "Invalid format: "2015-11-01 00:22:00.0" is malformed at " 00:22:00.0""  
}  
},{...

The mapping for only this (customDate) field is as follows:  
.....  
"customDate" : {  
"type" : "date",  
"format" : "YYYY-MM-dd HH:mm:ss.S"  
},  
.....

Data in sample.json is as follows:

...","customDate":"2015-11-01 00:09:00.0","...

I also tried deleting old index and creating a new one with applying mapping once again but it does not help.Please provide any suggestions or let me know in case I am missing anything?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 13, 2015, 3:07pm UTC](https://discuss.elastic.co/t/parsing-problem-with-custom-date-format-yyyy-mm-dd-hh-mm-ss-s-failing-when-called-with-bulk-api/37063/2 "2015-12-13T15:07:05Z")

</div>

Can you reproduce it from scratch?

May be your mapping has been applied?

---

<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, 11:31pm UTC](https://discuss.elastic.co/t/parsing-problem-with-custom-date-format-yyyy-mm-dd-hh-mm-ss-s-failing-when-called-with-bulk-api/37063/3 "2017-07-05T23:31:29Z")

</div>


