# How to convert string type to timestamp

**URL:** <https://discuss.elastic.co/t/how-to-convert-string-type-to-timestamp/148936>\
**Category:** Logstash\
**Created:** [September 18, 2018, 8:09am UTC](https://discuss.elastic.co/t/how-to-convert-string-type-to-timestamp/148936 "2018-09-18T08:09:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwesinhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shwesinhan/32/78663_2.png) [@shwesinhan](https://discuss.elastic.co/u/shwesinhan)\
**Post date:** [September 18, 2018, 8:09am UTC](https://discuss.elastic.co/t/how-to-convert-string-type-to-timestamp/148936/1 "2018-09-18T08:09:51Z")

</div>

hi there

i would like to convert string type to date timestamp

i create log\_timestamp field and others below msg by using grok filter  
eg log\_timestamp : 2018-09-18 14:14:49,036, log\_level : WARN , log\_type: Test Request

> 2018-09-18 14:14:49,036 (null) 32 WARN : V21.TestHelper : TestPage :: cde233w4qvqggy012l0gx4j3 :: Test Request : \<TestRequest\>\<Version\>2.0\</Version\>; : 30632979ms

problem is that i would like to get date type for log\_timestamp field  
currently it's string type but i don't want to override default @timestamp  
plz point out to me about it

thank you!!!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 18, 2018, 9:36am UTC](https://discuss.elastic.co/t/how-to-convert-string-type-to-timestamp/148936/2 "2018-09-18T09:36:02Z")

</div>

Use a date filter to convert the timestamp into a canonical ISO8601 timestamp that ES will automatically recognize as a timestamp.

---

<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:** [October 16, 2018, 9:36am UTC](https://discuss.elastic.co/t/how-to-convert-string-type-to-timestamp/148936/3 "2018-10-16T09:36:11Z")

</div>

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