# Another dateparse failure

**URL:** <https://discuss.elastic.co/t/another-dateparse-failure/259089>\
**Category:** Logstash\
**Created:** [December 18, 2020, 11:33am UTC](https://discuss.elastic.co/t/another-dateparse-failure/259089 "2020-12-18T11:33:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![calanon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/calanon/32/64004_2.png) [@calanon](https://discuss.elastic.co/u/calanon)\
**Post date:** [December 18, 2020, 11:33am UTC](https://discuss.elastic.co/t/another-dateparse-failure/259089/1 "2020-12-18T11:33:22Z")

</div>

I cant figure out how to match this:

**RAW output**  
`[2020-12-17T16:45:45+01:00]`

**Elasticsearch JSON**

```
Dez 18 11:03:58 mon logstash[23980]: "log_timestamp" => "2020-12-18T11:03:56+01:00",
Dez 18 11:03:58 mon logstash[23980]: "@version" => "1",
Dez 18 11:03:58 mon logstash[23980]: "tags" => [
Dez 18 11:03:58 mon logstash[23980]: [0] "live0",
Dez 18 11:03:58 mon logstash[23980]: [1] "beats_input_codec_plain_applied",
Dez 18 11:03:58 mon logstash[23980]: [2] "_dateparsefailure" 

```

**Date filter plugin**

```
date {
    match => ["log_timestamp", "yyyyMMdd HHmmss", "yyyyMMdd HHmmss,SSS", "yyyy-MM-dd'T'HH:mm:ss +0100"]
    target => "@timestamp"
    timezone => "Europe/Berlin"
    add_field => { "debug" => "timestampMatched" }
  }

```

**Grok match**  
`\[%{TIMESTAMP_ISO8601:log_timestamp}\]`

---

<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:** [December 18, 2020, 3:06pm UTC](https://discuss.elastic.co/t/another-dateparse-failure/259089/2 "2020-12-18T15:06:33Z")

</div>

> [@calanon](#):
>
> 2020-12-17T16:45:45+01:00

That would be `yyyy-MM-dd'T'HH:mm:ssZZ`.

---

<div class="post-metadata">

**Author:** ![calanon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/calanon/32/64004_2.png) [@calanon](https://discuss.elastic.co/u/calanon)\
**Post date:** [December 21, 2020, 8:51am UTC](https://discuss.elastic.co/t/another-dateparse-failure/259089/3 "2020-12-21T08:51:57Z")

</div>

@Badger  
Thanks for your reply badger but I am still getting a dateparsefailure with that pattern:

```
Dez 21 09:48:57 mon logstash[23980]: "log_timestamp" => "2020-12-21T09:48:50+01:00",
Dez 21 09:48:57 mon logstash[23980]: "@version" => "1",
Dez 21 09:48:57 mon logstash[23980]: "tags" => [
Dez 21 09:48:57 mon logstash[23980]: [0] "live0",
Dez 21 09:48:57 mon logstash[23980]: [1] "beats_input_codec_plain_applied",
Dez 21 09:48:57 mon logstash[23980]: [2] "_dateparsefailure" 

Dez 21 09:48:57 mon logstash[23980]: "@timestamp" => 2020-12-21T08:48:51.000Z,
Dez 21 09:48:57 mon logstash[23980]: "ecs" => {
Dez 21 09:48:57 mon logstash[23980]: "version" => "1.5.0"
Dez 21 09:48:57 mon logstash[23980]: },
```

---

<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:** [December 21, 2020, 4:57pm UTC](https://discuss.elastic.co/t/another-dateparse-failure/259089/4 "2020-12-21T16:57:41Z")

</div>

Not sure what would cause that. It works for me

```
input { generator { count => 1 lines => [''] } }
filter {
    mutate { add_field => { "log_timestamp" => "2020-12-18T11:03:56+01:00" } }
    date { match => ["log_timestamp", "yyyy-MM-dd'T'HH:mm:ssZZ"] target => "@timestamp" }
}
output { stdout { codec => rubydebug { metadata => false } } }

```

results in

```
   "@timestamp" => 2020-12-18T10:03:56.000Z,
```

---

<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:** [January 18, 2021, 4:57pm UTC](https://discuss.elastic.co/t/another-dateparse-failure/259089/5 "2021-01-18T16:57:48Z")

</div>

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