# Date filter failing with JDBC input

**URL:** https://discuss.elastic.co/t/date-filter-failing-with-jdbc-input/59198
**Category:** Logstash
**Created:** [August 29, 2016, 2:59pm UTC](https://discuss.elastic.co/t/date-filter-failing-with-jdbc-input/59198 "2016-08-29T14:59:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aethos](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aethos](https://discuss.elastic.co/u/aethos)
#### Post date: [August 29, 2016, 2:59pm UTC](https://discuss.elastic.co/t/date-filter-failing-with-jdbc-input/59198/1 "2016-08-29T14:59:01Z")

</div>

I have JDBC collecting from a database and then I'm feeding one of the fields to date to store it in timestamp. However I ran into an issue and found a workaround. Wondering if there might be a bug in JDBC input?

Basically the field "eventdt" is coming from the database. I use a date filter:  
date { match =\> ["eventdt", "ISO8601"] }

This results in an error:  
Failed parsing date from field", :field=\>"eventdt", :value=\>"2016-08-29T14:33:55.707Z", :exception=\>"cannot convert instance of class org.jruby.RubyObject to class java.lang.String", :config\_parsers=\>"ISO8601", :config\_locale=\>"default=en\_US"

I got around this issue by copying the field into metadata and parsing the metadata field instead.  
mutate { add\_field =\> ["[@metadata][datehold]", "%{eventdt}"] }  
date { match =\> ["[@metadata][datehold]", "ISO8601" ] }

Perhaps there is something special that JDBC input is doing with returned fields leaving them as objects or lacking the to\_s method or some such? Not a ruby expert here by any stretch of the imagination but thought I should report this.

---

<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: [July 6, 2017, 4:41am UTC](https://discuss.elastic.co/t/date-filter-failing-with-jdbc-input/59198/2 "2017-07-06T04:41:06Z")

</div>


