# Logstash unable to convert String to timestamp

**URL:** <https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315>\
**Category:** Logstash\
**Created:** [March 2, 2018, 8:32pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315 "2018-03-02T20:32:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marshall\_Wilson](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marshall\_Wilson](https://discuss.elastic.co/u/Marshall_Wilson)\
**Post date:** [March 2, 2018, 8:32pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/1 "2018-03-02T20:32:25Z")

</div>

Team

Sorry if this is a simple question. This is my first question in blog and tried many option from the website but it didn't help. Kindly assist on the below. Thanks

I have a grok variable %{GREEDYDATA:LastBeginDateTime1} which matches 2018-03-01 02:30:33  
In my config I am trying to change it to timestamp like

date  
{  
match =\> ["LastBeginDateTime1", "YYYY-MM-DD HH:mm:ss"]  
timezone =\> "America/Chicago"  
target =\> "@timestamp"  
}

But however i still see the variable as string in my Kibana dashboard. Can you please help? Thanks a lot

---

<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:** [March 2, 2018, 9:10pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/2 "2018-03-02T21:10:30Z")

</div>

> [@Marshall\_Wilson](#):
>
> however i still see the variable as string in my Kibana dashboard

LastBeginDateTime1 _should_ still be a string. The question is whether @timestamp (which you set as the target) is equal to the parsed value for LastBeginDateTime1.

If you want LastBeginDateTime1 to be a timestamp then set that as the target, but since you already have LastBeginDateTime1 as a string in your index you will get a type conflict.

---

<div class="post-metadata">

**Author:** ![Marshall\_Wilson](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marshall\_Wilson](https://discuss.elastic.co/u/Marshall_Wilson)\
**Post date:** [March 2, 2018, 9:36pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/3 "2018-03-02T21:36:27Z")

</div>

Thanks. I see the @timestamp value changed but it is not equal to LastBeginDateTime1

My LastBeginDateTime1 is 2018-03-01 14:00:14  
However my @timestamp is showing as "January 1st 2018, 14:00:14.000"  
Also instead of updating @timestamp how to update it to a new variable of which is of similar to @timestamp

Config

date  
{  
match =\> ["Batch\_LastBeginDateTime1", "YYYY-MM-DD HH:mm:ss"]  
timezone =\> "America/Chicago"  
target =\> "@timestamp"  
}

---

<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:** [March 2, 2018, 10:01pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/4 "2018-03-02T22:01:59Z")

</div>

🤣 "YYYY-MM-dd HH:mm:ss", not "YYYY-MM-DD HH:mm:ss"

DD is day of the year, and day 1 is Jan 1st. That's overriding the month.

---

<div class="post-metadata">

**Author:** ![Marshall\_Wilson](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marshall\_Wilson](https://discuss.elastic.co/u/Marshall_Wilson)\
**Post date:** [March 2, 2018, 10:13pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/5 "2018-03-02T22:13:33Z")

</div>

😛 Thanks a lot. Can you please let me know how to save it in a new variable other than @timestamp?

---

<div class="post-metadata">

**Author:** ![Marshall\_Wilson](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marshall\_Wilson](https://discuss.elastic.co/u/Marshall_Wilson)\
**Post date:** [March 2, 2018, 10:20pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/6 "2018-03-02T22:20:59Z")

</div>

Got it into a different timestamp variable. Thanks a lot

---

<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 30, 2018, 10:21pm UTC](https://discuss.elastic.co/t/logstash-unable-to-convert-string-to-timestamp/122315/7 "2018-03-30T22:21:18Z")

</div>

Closed on March 30, 2018, 10:21pm UTC

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