# MapperParsingException failed to parse date format

**URL:** https://discuss.elastic.co/t/mapperparsingexception-failed-to-parse-date-format/53441
**Category:** Elasticsearch
**Created:** [June 21, 2016, 7:37am UTC](https://discuss.elastic.co/t/mapperparsingexception-failed-to-parse-date-format/53441 "2016-06-21T07:37:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Rajkumar\_E](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Rajkumar\_E](https://discuss.elastic.co/u/Rajkumar_E)
#### Post date: [June 21, 2016, 7:37am UTC](https://discuss.elastic.co/t/mapperparsingexception-failed-to-parse-date-format/53441/1 "2016-06-21T07:37:41Z")

</div>

I have exception for pushing mysql data to elasticxsearch. I stored mysql date value to "Current\_time\_stamp" its look like "2016-06-20 12:25:58"

This is Table Data:

```
           id name mail ip timedate socketid reson active deactive
           1 Bilal ABD@gmail.com 192.168.1.5 2016-06-20 12:25:58 /#j9h5AC cancel 2016-06-20 12:25:58 2016-06-20 12:27:12

```

Mysql Show only this format **"2016-06-20 12:25:58"** , If elasticsearch get **"2016-06-21 12:56:42 +0530"**

So i Put Date fomat to:

```
            "format": "yyyy-MM-dd HH:mm:ss|| yyyy-MM-dd HH:mm +SSSS||yyyy-MM-dd||epoch_millis"

```

Index Mapping:

```
        {
    "properties": {
      "active": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss|| yyyy-MM-dd HH:mm +SSSS||yyyy-MM-dd||epoch_millis"
        
      },
      "deactive": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss|| yyyy-MM-dd HH:mm +SSSS||yyyy-MM-dd||epoch_millis"
       
      },
      "id": {
        "type": "long"
      },
      "ip": {
        "type": "string",
        "index": "not_analyzed"
      },
      "mail": {
        "type": "string",
        "index": "not_analyzed"
      },
      "name": {
        "type": "string",
        "index": "not_analyzed"
      },
      "reason": {
        "type": "string",
        "index": "not_analyzed"
      },
      "socketid": {
        "type": "string",
        "index": "not_analyzed"
      },
      "timedate": {
       "type": "date",
       "format": "yyyy-MM-dd HH:mm:ss|| yyyy-MM-dd HH:mm +SSSS ||yyyy-MM-dd||epoch_millis"
      }
    }
  }

```

But Elasticsearch Throw Error:

```
    [2016-06-21 12:45:54,846][DEBUG][action.bulk] [Supremor] [chatmaster][1] failed to execute bulk item (index) index {[chatmaster][chatmastertype][21], source[{"id":21,"name":"Bilal","mail":"bilalusean@gmail.com","ip":"127.0.0.1","timedate":"2016-06-21 12:09:52 +0530","socketid":"/#hjV00hZrEvFUlXeWAAAG","reason":"others","active":"2016-06-21 12:09:52 +0530","deactive":"2016-06-21 12:11:52 +0530"}]}
    MapperParsingException[failed to parse [timedate]]; nested: IllegalArgumentException[Invalid format: "2016-06-21 12:09:52 +0530" is malformed at " +0530"];
      at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:329)

```

Suggest me Which Format use to Push This Mysql Data to Elkasticsearch .

---

<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: [June 21, 2016, 8:22am UTC](https://discuss.elastic.co/t/mapperparsingexception-failed-to-parse-date-format/53441/2 "2016-06-21T08:22:01Z")

</div>

IIRC +SSSS does not mean TimeZone.

None of the formats you provided matches the string you are sending.

---

<div class="post-metadata">

### Author: ![Rajkumar\_E](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Rajkumar\_E](https://discuss.elastic.co/u/Rajkumar_E)
#### Post date: [June 21, 2016, 2:17pm UTC](https://discuss.elastic.co/t/mapperparsingexception-failed-to-parse-date-format/53441/3 "2016-06-21T14:17:45Z")

</div>

I have solve this problem, while I using this format " **yyyy-MM-dd HH:mm:ss Z**" refer this link [http://www.fileformat.info/tip/java/simpledateformat.htm](http://www.fileformat.info/tip/java/simpledateformat.htm) to check our date pattern.

---

<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:41pm UTC](https://discuss.elastic.co/t/mapperparsingexception-failed-to-parse-date-format/53441/4 "2017-07-05T22:41:44Z")

</div>


