# Logstash parsed the date, and saved as string

**URL:** <https://discuss.elastic.co/t/logstash-parsed-the-date-and-saved-as-string/169883>\
**Category:** Logstash\
**Created:** [February 25, 2019, 5:06pm UTC](https://discuss.elastic.co/t/logstash-parsed-the-date-and-saved-as-string/169883 "2019-02-25T17:06:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scorpioy1](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@scorpioy1](https://discuss.elastic.co/u/scorpioy1)\
**Post date:** [February 25, 2019, 5:06pm UTC](https://discuss.elastic.co/t/logstash-parsed-the-date-and-saved-as-string/169883/1 "2019-02-25T17:06:13Z")

</div>

Hi, here is my logstash

filter {

csv {  
columns =\> ["nowdate","Total","DIFF"]  
convert =\> {  
"Total" =\> "integer"  
"DIFF" =\> "integer"  
}  
}

```
date {
  match => ["nowdate", "yyyy-mm-dd HH:mm:ss.SSS", "ISO8601"] 
}	 

```

When I import it in Kibana, I found the column nowdate is a type of string, although it does saves it as a separate column as 'nowdate'. How should I change to make it saved as 'date' type?

Thanks

---

<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:** [February 25, 2019, 5:13pm UTC](https://discuss.elastic.co/t/logstash-parsed-the-date-and-saved-as-string/169883/2 "2019-02-25T17:13:11Z")

</div>

First, you may be able to use csv+convert to parse the date since convert accepts date and date\_time as options.

Second, you have left the target of the date filter as the default, which is @timestamp. If you want it to overwrite nowdate then add

```
target => "nowdate"

```

If you want it to go to both @timestamp and nowdate then do not set the target but instead use mutate+copy after the date filter.

---

<div class="post-metadata">

**Author:** ![scorpioy1](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@scorpioy1](https://discuss.elastic.co/u/scorpioy1)\
**Post date:** [February 25, 2019, 5:35pm UTC](https://discuss.elastic.co/t/logstash-parsed-the-date-and-saved-as-string/169883/3 "2019-02-25T17:35:04Z")

</div>

Thanks Badger, use "nowdate" =\> "date" doesn't work.  
But using target made it working.

---

<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 25, 2019, 5:35pm UTC](https://discuss.elastic.co/t/logstash-parsed-the-date-and-saved-as-string/169883/4 "2019-03-25T17:35:05Z")

</div>

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