# \_dateparsefailure for date filtering on database date column value

**URL:** <https://discuss.elastic.co/t/-dateparsefailure-for-date-filtering-on-database-date-column-value/81918>\
**Category:** Logstash\
**Created:** [April 11, 2017, 6:18am UTC](https://discuss.elastic.co/t/-dateparsefailure-for-date-filtering-on-database-date-column-value/81918 "2017-04-11T06:18:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggajanan](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@ggajanan](https://discuss.elastic.co/u/ggajanan)\
**Post date:** [April 11, 2017, 6:18am UTC](https://discuss.elastic.co/t/-dateparsefailure-for-date-filtering-on-database-date-column-value/81918/1 "2017-04-11T06:18:58Z")

</div>

Hi,

I am using jdbc input and want to match @timestamp with the updatedttm column value extracted from the query execution. It is not working and also failing with \_dateparsefailure.

Following is the config from logstash conf file

```
input {
   jdbc {
      type => "recon"
      jdbc_driver_library => "C:\tools\ELK\logstash\jdbc-drivers\db2jcc4.jar"
      jdbc_driver_class => "com.ibm.db2.jcc.DB2Driver"
      jdbc_connection_string => "jdbc:db2://localhost:50000/DATABASE"
      jdbc_user => "user"
      jdbc_password => "pass"
      jdbc_validate_connection => true
      schedule => "* * * * *"
      statement => "select name, ky1, updatedttm from table1 updatedttm > :sql_last_value"
      last_run_metadata_path => "C:\tools\ELK\logstash\logstash_jdbc_last_run"
   }
}

filter {
    date {
  	match => ["updatedttm", "yyyy-MM-dd'T'HH:mm:ss.SSSZ"]
	target => "@timestamp"
   }
}

output {
        stdout {
            codec => rubydebug
        }
}

```

following is the output from the execution and @timestamp does not match with updatedttm.

```
{
  "name" => "test1",
  "@timestamp" => 2017-04-11T05:53:00.500Z,
  "ky1" => 648503,
  "@version" => "1",
  "updatedttm" => 2016-02-18T10:02:19.190Z,
  "type" => "recon",
  "tags" => [
    [0] "_dateparsefailure"
  ]
}

```

Can you please suggest how can I correct this?

Thank you!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 11, 2017, 6:25am UTC](https://discuss.elastic.co/t/-dateparsefailure-for-date-filtering-on-database-date-column-value/81918/2 "2017-04-11T06:25:07Z")

</div>

If the date filter fails it'll tell you why in the Logstash log.

---

<div class="post-metadata">

**Author:** ![ggajanan](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@ggajanan](https://discuss.elastic.co/u/ggajanan)\
**Post date:** [April 11, 2017, 1:58pm UTC](https://discuss.elastic.co/t/-dateparsefailure-for-date-filtering-on-database-date-column-value/81918/3 "2017-04-11T13:58:12Z")

</div>

Thanks!

The following mutate fixed it.

```
filter {
    mutate {
       convert => ["updatedttm", "string"]
    }
    date {
  	   match => ["updatedttm", "yyyy-MM-dd'T'HH:mm:ss.SSSZ"]
	   target => "@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:** [May 9, 2017, 2:05pm UTC](https://discuss.elastic.co/t/-dateparsefailure-for-date-filtering-on-database-date-column-value/81918/4 "2017-05-09T14:05:02Z")

</div>

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