# Cant parse date from log

**URL:** <https://discuss.elastic.co/t/cant-parse-date-from-log/233315>\
**Category:** Logstash\
**Created:** [May 19, 2020, 12:22pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315 "2020-05-19T12:22:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deny7](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@Deny7](https://discuss.elastic.co/u/Deny7)\
**Post date:** [May 19, 2020, 12:22pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315/1 "2020-05-19T12:22:51Z")

</div>

Hi, im trying to parse timestamp from from log to field so I can choose it when creating new index. Date format from log is: **2020-05-19 11:03:18.954** In logstash I defined:

```
date{
       match => ["timestamp", "YYYY-MM-dd HH:mm:ss.SSS"]
       target => "timestamp"
    }         	

```

grok pattern: **%{TIMESTAMP\_ISO8601:timestamp}**.........  
But still in index creation page I can only see @timestamp to choose. Can somebody help?

---

<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, 2020, 2:21pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315/2 "2020-05-19T14:21:54Z")

</div>

What type does the [timestamp] field have if you check it in the index management pages in kibana?

---

<div class="post-metadata">

**Author:** ![Deny7](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@Deny7](https://discuss.elastic.co/u/Deny7)\
**Post date:** [May 19, 2020, 2:51pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315/3 "2020-05-19T14:51:31Z")

</div>

@Badger It has String type.

---

<div class="post-metadata">

**Author:** ![Deny7](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@Deny7](https://discuss.elastic.co/u/Deny7)\
**Post date:** [May 19, 2020, 3:18pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315/4 "2020-05-19T15:18:15Z")

</div>

Ok now its working, It looks like only restarting logstash and then click on refresh button on page where you choose timestamp is not enough, I had to restart filebeat too and now I can choose timestamp from log.

---

<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, 2020, 3:26pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315/5 "2020-05-19T15:26:36Z")

</div>

Once a field in an index is a string, it will stay a string. Even if you feed elasticsearch a Logstash::Timestamp, it will convert it to a string if the field already exists. If you roll over to a new index it will start being indexed 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:** [June 16, 2020, 3:26pm UTC](https://discuss.elastic.co/t/cant-parse-date-from-log/233315/6 "2020-06-16T15:26:58Z")

</div>

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