# Conver String to date (or replace @timestamp) (SOLVED)

**URL:** <https://discuss.elastic.co/t/conver-string-to-date-or-replace-timestamp-solved/32957>\
**Category:** Logstash\
**Created:** [October 26, 2015, 7:13am UTC](https://discuss.elastic.co/t/conver-string-to-date-or-replace-timestamp-solved/32957 "2015-10-26T07:13:56Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![gaurav1424](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gaurav1424](https://discuss.elastic.co/u/gaurav1424)\
**Post date:** [January 22, 2016, 11:41pm UTC](https://discuss.elastic.co/t/conver-string-to-date-or-replace-timestamp-solved/32957/12 "2016-01-22T23:41:45Z")

</div>

> [@magnusbaeck](#):
>
> Use the date filter to parse a string and convert it to an ISO8601 timestamp (usually stored in the @timestamp). No Ruby filter is necessary for this.

I have Syslog timestamp from event parsed by logstash as : "syslog\_timestamp" =\> "Jan 22 15:20:36"  
How do I convert into timestamp / time format (instead of string) so that It can be searchable and I can apply time based query in Elasticsearch ?  
I do this:  
date {  
target =\> "syslog\_timestamp"  
match =\> ["syslog\_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]  
}

Still output is :  
{  
"syslog\_timestamp" =\> "Jan 22 15:20:36",  
"@timestamp" =\> "2016-01-22T23:20:36.000Z"  
}

---

_[View the full topic](https://discuss.elastic.co/t/conver-string-to-date-or-replace-timestamp-solved/32957)._
