# Date format rejected, no apparent reason why

**URL:** <https://discuss.elastic.co/t/date-format-rejected-no-apparent-reason-why/125082>\
**Category:** Logstash\
**Created:** [March 21, 2018, 10:03pm UTC](https://discuss.elastic.co/t/date-format-rejected-no-apparent-reason-why/125082 "2018-03-21T22:03:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorj1234](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dorj1234/32/21339_2.png) [@dorj1234](https://discuss.elastic.co/u/dorj1234)\
**Post date:** [March 21, 2018, 10:03pm UTC](https://discuss.elastic.co/t/date-format-rejected-no-apparent-reason-why/125082/1 "2018-03-21T22:03:56Z")

</div>

Hello, I am trying to understand the following error:  
The main problem is at the bottom of the error:

```auto
Invalid format: \"2018-03-11 02:48:31\" is malformed at \" 02:48:31\"

```

`[2018-03-21T15:59:35,601][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"1995397226128", :_index=>"unifieddxcvpc", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x3863e85>], :response=>{"index"=>{"_index"=>"unifieddxcvpc", "_type"=>"doc", "_id"=>"1995397226128", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [datetime]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"2018-03-11 02:48:31\" is malformed at \" 02:48:31\""}}}}}`

The logstash date mapping does handle this date format. Here is my mapping:

```auto
date {
  target => ["datetime"] 
  match => ["datetime", "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd:HH:mm:ss"]
}

```

So I don't see why logstash will consider this data malformed. Here is the entry the error refers to (you can see `"2018-03-11 02:48:31"` clearly in here:

`"EMEA";"Spain";"Barcelona";"ACR";"NONE";"VDI";"NONE";"NONE";"NONE";"domain";"Compute-DC";"text1";"1995397225952";"2018-03-11 02:48:31";"_TX4O0CTOEeiiGuzjU82SIA";"SP102-HAVS-LG-00203";"4232c628-94a1-032c-7665-476329da6cac";"MOVE";"PENDING_ACCEPT";"MANUAL";"30";"0";"0";"l2a2-3b19-u03-b08.acr.ecs.hp.com";"l2a2-3b19-u14-b08.acr.ecs.hp.com";"Mem congestion on Physical Machine 'l2a2-3b19-u03-b08.acr.ecs.hp.com'";"False";"Mem Congestion";"Performance Assurance";"Major"`

I will try to change the order of the mapping matches, but it's supposed to keep trying all the mappings until it succeeds, no?

Your advice is much appreciated.  
Best,  
JD

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 22, 2018, 1:38am UTC](https://discuss.elastic.co/t/date-format-rejected-no-apparent-reason-why/125082/2 "2018-03-22T01:38:30Z")

</div>

> [@dorj1234](#):
>
> Invalid format: "2018-03-11 02:48:31" is malformed at " 02:48:31"

Daylight savings time? Where I live there was no 02:48 on 3/11. We skipped straight from 01:59 to 03:00.

You could test if 01:48 and 03:48 parse correctly.

---

<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:** [April 19, 2018, 1:38am UTC](https://discuss.elastic.co/t/date-format-rejected-no-apparent-reason-why/125082/3 "2018-04-19T01:38:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
