# Logstash cannot assign correct date to log timestamp

**URL:** <https://discuss.elastic.co/t/logstash-cannot-assign-correct-date-to-log-timestamp/89249>\
**Category:** Logstash\
**Created:** [June 13, 2017, 5:30pm UTC](https://discuss.elastic.co/t/logstash-cannot-assign-correct-date-to-log-timestamp/89249 "2017-06-13T17:30:52Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![John\_06](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@John\_06](https://discuss.elastic.co/u/John_06)\
**Post date:** [June 13, 2017, 8:15pm UTC](https://discuss.elastic.co/t/logstash-cannot-assign-correct-date-to-log-timestamp/89249/7 "2017-06-13T20:15:50Z")

</div>

This is complete filter section:

```
filter {
  grok {
    match => {"message" => "(?<logTime>[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3})"}
  }
  ruby {
    code => 'event.set("logTimestamp", Time.now.strftime('%Y-%m-%d') + ' ' + event.get("logTime"))'
  }
  date {
    match => ["logTimestamp", "YYYY-MM-dd HH:mm:ss,SSS"]
    timezone => "America/Chicago"
  }
}

```

And Logstash complains about this part`('%Y-%m-%d')`

I cannot find any examples in docs, not sure what could be wrong with syntax.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-cannot-assign-correct-date-to-log-timestamp/89249)._
