# Error to map date field with format yyyy-MM-dd HH:mm:ss.SSS

**URL:** https://discuss.elastic.co/t/error-to-map-date-field-with-format-yyyy-mm-dd-hhss-sss/160341
**Category:** Logstash
**Created:** [December 11, 2018, 10:03am UTC](https://discuss.elastic.co/t/error-to-map-date-field-with-format-yyyy-mm-dd-hhss-sss/160341 "2018-12-11T10:03:30Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)
#### Post date: [December 11, 2018, 11:02am UTC](https://discuss.elastic.co/t/error-to-map-date-field-with-format-yyyy-mm-dd-hhss-sss/160341/3 "2018-12-11T11:02:07Z")

</div>

Hello, thanks for reply  
the above format didnt work for me.  
The sample date format present in database for column updated\_date is as shown  
2017-12-18 00:00:00.000

Here is the input code,

input {

jdbc {  
jdbc\_driver\_library =\> "D:/Softwares/logstash-6.4.2/lib/sqljdbc4-2.0.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver:// **:** /\*\*\*"  
jdbc\_user =\> "####"  
jdbc\_password =\> "###"  
statement =\> "SELECT id, name , updated\_date FROM sample"  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "50000"  
}

}

output{  
elasticsearch { codec =\> json hosts =\> ["localhost:9200"] index =\> "idx\_sqldata" }  
stdout { codec =\> rubydebug }  
}

# Output

Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"idx\_sqldata", :\_type=\>"\_doc", :\_routing=\>nil}, #LogStash::Event:0x613cc85f], :response=\>{"index"=\>{"\_index"=\>"idx\_sqldata", "\_type"=\>"\_doc", "\_id"=\>"bcDpnGcBu0SneeiwZGsB", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [updated\_date]", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Invalid format: "2018-11-21T18:30:00.000Z" is malformed at "Z""}}}}}

---

_[View the full topic](https://discuss.elastic.co/t/error-to-map-date-field-with-format-yyyy-mm-dd-hhss-sss/160341)._
