# Date parse failure, cannot figure out pattern for literal characters in time stamp field

**URL:** https://discuss.elastic.co/t/date-parse-failure-cannot-figure-out-pattern-for-literal-characters-in-time-stamp-field/179412
**Category:** Logstash
**Created:** [May 2, 2019, 5:19pm UTC](https://discuss.elastic.co/t/date-parse-failure-cannot-figure-out-pattern-for-literal-characters-in-time-stamp-field/179412 "2019-05-02T17:19:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tomj](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@tomj](https://discuss.elastic.co/u/tomj)
#### Post date: [May 2, 2019, 5:19pm UTC](https://discuss.elastic.co/t/date-parse-failure-cannot-figure-out-pattern-for-literal-characters-in-time-stamp-field/179412/1 "2019-05-02T17:19:12Z")

</div>

Using Logstash 6.4.3

I am processing Kinesis records from the Kinesis input plugin, where the 'timestamp' field looks like this:

2019-05-02T16:25:17.850884549Z

I am using the following date filter syntax (following suggestions in the docs):

`filter { date { match => ["timestamp", "yyyy-MM-dd'T'HH:mm:ss,SSS'Z'"] target => "timestamp" } }`

However, Logstash does not accept this; here is an example log message (extraneous fields omitted):

`[2019-05-02T17:06:59,934][DEBUG][logstash.pipeline] output received {"event"=>{"@version"=>"1", "fields"=>{ "@timestamp"=>2019-05-02T17:06:59.833Z, "timestamp"=>2019-05-02T17:06:57.880Z, "tags"=>["_dateparsefailure"]}}`

Edit: I should also mention that I get similar results when using the ISO8601 format literal.

---

<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: [May 2, 2019, 6:30pm UTC](https://discuss.elastic.co/t/date-parse-failure-cannot-figure-out-pattern-for-literal-characters-in-time-stamp-field/179412/2 "2019-05-02T18:30:32Z")

</div>

> [@tomj](#):
>
> "timestamp"=\>2019-05-02T17:06:57.880Z

There are no quotes around timestamp, so that is a Logstash::TimeStamp, not a string. A date filter [cannot](https://github.com/logstash-plugins/logstash-filter-date/issues/95) parse a Logstash::Timestamp.

I am not familiar with kinesis but I know that for jdbc the input will convert datetimes in the database into Logstash::Timestamp for you, so you do not need a date filter. It may be the same for kinesis.

If adding

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

```

makes the error go away then you can just delete the date filter.

---

<div class="post-metadata">

### Author: ![tomj](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@tomj](https://discuss.elastic.co/u/tomj)
#### Post date: [May 2, 2019, 8:37pm UTC](https://discuss.elastic.co/t/date-parse-failure-cannot-figure-out-pattern-for-literal-characters-in-time-stamp-field/179412/3 "2019-05-02T20:37:30Z")

</div>

I apologize, I should have stated I was using the JSON codec with the Kinesis input for clarity.

As it turns out, I don't need either the date filter or the mutate to make it work. I inherited the configuration and just assumed that it was working all along. I had never checked the output and thus did not see the \_dateparsefailure messages until now.

Thank you, and thanks for the link to the issue. I searched Logstash issues but not the specific plugin repository issues; now I know better.

---

<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 30, 2019, 8:37pm UTC](https://discuss.elastic.co/t/date-parse-failure-cannot-figure-out-pattern-for-literal-characters-in-time-stamp-field/179412/4 "2019-05-30T20:37:34Z")

</div>

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