# How to change Date format from YYYY-MM-DD to DD/MMM/YYYY

**URL:** <https://discuss.elastic.co/t/how-to-change-date-format-from-yyyy-mm-dd-to-dd-mmm-yyyy/132569>\
**Category:** Logstash\
**Created:** [May 19, 2018, 12:50pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-from-yyyy-mm-dd-to-dd-mmm-yyyy/132569 "2018-05-19T12:50:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThiruG](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@ThiruG](https://discuss.elastic.co/u/ThiruG)\
**Post date:** [May 19, 2018, 12:50pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-from-yyyy-mm-dd-to-dd-mmm-yyyy/132569/1 "2018-05-19T12:50:58Z")

</div>

Hi,

To Monitor a application through logstash, i need to change format of data field from YYYY-MM-DD (2018-05-19) to DD/MMM/YYYY (19/May/2018) please suggest how to achive it.

---

<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:** [May 19, 2018, 2:40pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-from-yyyy-mm-dd-to-dd-mmm-yyyy/132569/2 "2018-05-19T14:40:54Z")

</div>

```
  mutate { add_field => { "[date1]" => "2018-05-19" } }
  ruby { code => "event.set('date2', Date.strptime(event.get('[date1]'), '%Y-%m-%d').strftime('%d/%b/%Y'))" }

```

does it. Error handling left as an exercise for the reader.

---

<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:** [June 16, 2018, 2:41pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-from-yyyy-mm-dd-to-dd-mmm-yyyy/132569/3 "2018-06-16T14:41:52Z")

</div>

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