Malformed date value? But the date and the template match

CSV data looks like his

220364000,2015-09-04 11:04:23,Under way using engine,65.5000000,-53.5114983

Mapping to create index a009 was created this way.

$ curl -XPUT '' -d '{
"mappings": {
"type": {
"properties": {
"mmsi" : { "type": "string" },
"datetime" : { "type": "date", "format": "YYYY-MM-dd HH:mm:ss"},
"status" : { "type": "string", "index": "not_analyzed" },
"lat" : { "type": "float" },
"long" : { "type": "float" }

Getting this error:

"reason"=>"failed to parse [datetime]",
"reason"=>"Invalid format: "2015-09-04 11:04:23" is malformed at " 11:04:23""}}

How is it that

2015-09-04 11:04:23 (a date value)

is malformed?

I've moved this to the ES area as it's more suitable than LS :slight_smile:

OK... Thanks.

I could be wrong but I think you have to wrap literal characters in ''s so your format in your mapping should be:

 "format": "YYYY-MM-dd' 'HH:mm:ss"

see and for more details on the date format

This works for me in ES2.0, only diff I see is yyyy vs YYYY

"post_date_gmt": {
                "type": "date",
                "format": "yyyy-MM-dd HH:mm:ss"