# Change default date format via Logstash to store in ES

**URL:** <https://discuss.elastic.co/t/change-default-date-format-via-logstash-to-store-in-es/118612>\
**Category:** Logstash\
**Created:** [February 6, 2018, 10:32am UTC](https://discuss.elastic.co/t/change-default-date-format-via-logstash-to-store-in-es/118612 "2018-02-06T10:32:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moriol](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@moriol](https://discuss.elastic.co/u/moriol)\
**Post date:** [February 6, 2018, 10:32am UTC](https://discuss.elastic.co/t/change-default-date-format-via-logstash-to-store-in-es/118612/1 "2018-02-06T10:32:10Z")

</div>

I have some data being ingested via Logstash where a specific date field is stored as below in ES:  
"MyDate": "2018-01-17T10:11:59.982Z

I would like to store this date in ES , as a date field in format as follows:  
"MyDate": "2018/01/17 10:11:59.982"

Is it possible to do this, in a away that it will be recognized as a date field?

---

<div class="post-metadata">

**Author:** ![paz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paz/32/28003_2.png) [@paz](https://discuss.elastic.co/u/paz)\
**Post date:** [February 6, 2018, 10:42am UTC](https://discuss.elastic.co/t/change-default-date-format-via-logstash-to-store-in-es/118612/2 "2018-02-06T10:42:45Z")

</div>

You can format that field accordingly in Logstash and define a [custom date format](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html) for that field in ElasticSearch.

---

<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:** [March 6, 2018, 10:42am UTC](https://discuss.elastic.co/t/change-default-date-format-via-logstash-to-store-in-es/118612/3 "2018-03-06T10:42:57Z")

</div>

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