# Invalid format: "2019-05-16" is too short

**URL:** https://discuss.elastic.co/t/invalid-format-2019-05-16-is-too-short/191988
**Category:** Elasticsearch
**Created:** [July 24, 2019, 9:08am UTC](https://discuss.elastic.co/t/invalid-format-2019-05-16-is-too-short/191988 "2019-07-24T09:08:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zxyyxzzxy001](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zxyyxzzxy001](https://discuss.elastic.co/u/zxyyxzzxy001)
#### Post date: [July 24, 2019, 9:08am UTC](https://discuss.elastic.co/t/invalid-format-2019-05-16-is-too-short/191988/1 "2019-07-24T09:08:18Z")

</div>

I use logstash transfer data from mysql to elasticsearch.When logstash output data to elasticsearch,it throw an exception : Invalid format: "2019-05-16" is too short.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1b3f13438429e617baceab45c4ad92127ddb0d67.png)  
the column start\_date in mysql data type is date.I have another column named complete\_time and it's mysql data type is datetime.I've tried set the date format in template/logstash.json but the problem still happens.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/8/987ff8985058e0fe5e9c50c07498935d95348245.png)

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [August 1, 2019, 12:01pm UTC](https://discuss.elastic.co/t/invalid-format-2019-05-16-is-too-short/191988/2 "2019-08-01T12:01:59Z")

</div>

you can add another format like `yyyy-MM-dd` to the list of formats. You could also just go with `strict_date_optional_time||epoch_millis` or `date_optional_time||epoch_millis` in your mapping.

--Alex

---

<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: [August 29, 2019, 12:01pm UTC](https://discuss.elastic.co/t/invalid-format-2019-05-16-is-too-short/191988/3 "2019-08-29T12:01:59Z")

</div>

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