# Dateparsefailure while trying to overwrite timestamp with result date in same format

**URL:** <https://discuss.elastic.co/t/dateparsefailure-while-trying-to-overwrite-timestamp-with-result-date-in-same-format/175381>\
**Category:** Logstash\
**Created:** [April 4, 2019, 10:19am UTC](https://discuss.elastic.co/t/dateparsefailure-while-trying-to-overwrite-timestamp-with-result-date-in-same-format/175381 "2019-04-04T10:19:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saif3r](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@saif3r](https://discuss.elastic.co/u/saif3r)\
**Post date:** [April 4, 2019, 10:19am UTC](https://discuss.elastic.co/t/dateparsefailure-while-trying-to-overwrite-timestamp-with-result-date-in-same-format/175381/1 "2019-04-04T10:19:13Z")

</div>

Hello,  
I'm getting my results from JDBC query and as a result I have two columns:

```
"process_date_local" => 2019-01-08T12:35:52.000Z,
"@timestamp" => 2019-04-04T10:16:33.621Z,

```

I'm trying to use process\_date\_local as a @timestamp using date filter, but I'm getting parse failure error. This is what I used:

> filter {  
> date {  
> match =\> ["process\_date\_local", "YYYY-MM-dd'T'HH:mm:ss.SSSZ"]  
> }  
> }

Could you tell me what might be the issue or where can i find error details?  
Thanks!

---

<div class="post-metadata">

**Author:** ![saif3r](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@saif3r](https://discuss.elastic.co/u/saif3r)\
**Post date:** [April 4, 2019, 10:54am UTC](https://discuss.elastic.co/t/dateparsefailure-while-trying-to-overwrite-timestamp-with-result-date-in-same-format/175381/2 "2019-04-04T10:54:45Z")

</div>

Seems like i got it solved. I've been missing grok pattern in my config. Here's new filter from my config:

> filter {  
> grok {  
> match =\> { "process\_date\_local" =\> "%{TIMESTAMP\_ISO8601:[@metadata][timestamp]}" }  
> }  
> date {  
> match =\> ["[@metadata][timestamp]", "yyyy-MM-dd'T'HH:mm:ss.SSSZ"]  
> }  
> }

Here's the result:

```
"process_date_local" => 2019-01-08T12:35:53.000Z,
"@timestamp" => 2019-01-08T12:35:53.000Z,

```

---

<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 4, 2019, 11:27am UTC](https://discuss.elastic.co/t/dateparsefailure-while-trying-to-overwrite-timestamp-with-result-date-in-same-format/175381/3 "2019-04-04T11:27:52Z")

</div>

This is known [issue](https://github.com/logstash-plugins/logstash-filter-date/issues/95). The date filter cannot parse a Logstash::Timestamp. The normal workaround is to convert it to a string before parsing it

```
mutate { convert => { "process_date_local" => "string" } }
```

---

<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 2, 2019, 11:27am UTC](https://discuss.elastic.co/t/dateparsefailure-while-trying-to-overwrite-timestamp-with-result-date-in-same-format/175381/4 "2019-05-02T11:27:54Z")

</div>

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