# Using convert =\> date in csv filter

**URL:** <https://discuss.elastic.co/t/using-convert-date-in-csv-filter/127684>\
**Category:** Logstash\
**Created:** [April 11, 2018, 5:12pm UTC](https://discuss.elastic.co/t/using-convert-date-in-csv-filter/127684 "2018-04-11T17:12:45Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [April 11, 2018, 5:12pm UTC](https://discuss.elastic.co/t/using-convert-date-in-csv-filter/127684/1 "2018-04-11T17:12:46Z")

</div>

What am I missing here? When I run this configuration

```auto
input { generator { message => '2018/03/16,2018-02-15,2003-11-19 13:01:59' count => 1 } }
output { stdout { codec => rubydebug } }

filter {
  csv { convert => { "column1" => "date" "column2" => "date" "column3" => "date_time" } }
}

```

I get the following, where column1 clearly was not converted.

```auto
       "column1" => "2018/03/16",
       "column2" => 2018-02-15T05:00:00.000Z,
       "column3" => 2003-11-19T13:01:59.000Z,
    "@timestamp" => 2018-04-11T17:03:41.220Z

```

The csv filter uses CSV::Converters, and the documentation for those say that the :date converter "Converts any field Date::parse() accepts". When I run "logstash -i irb" it appears to me to parse the column1 format just fine

```auto
irb(main):001:0> Date.parse('2018-02-15')
=> #<Date: 2018-02-15 ((2458165j,0s,0n),+0s,2299161j)>
irb(main):002:0> Date.parse('2018/02/15')
=> #<Date: 2018-02-15 ((2458165j,0s,0n),+0s,2299161j)>

```

I can workaround this using a date{} filter, but I am curious how I can find out what formats are accepted by a convert =\> date.

---

<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:** [May 9, 2018, 5:12pm UTC](https://discuss.elastic.co/t/using-convert-date-in-csv-filter/127684/2 "2018-05-09T17:12:49Z")

</div>

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