# Dateparsefailure

**URL:** <https://discuss.elastic.co/t/dateparsefailure/258133>\
**Category:** Logstash\
**Created:** [December 9, 2020, 1:48pm UTC](https://discuss.elastic.co/t/dateparsefailure/258133 "2020-12-09T13:48:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Faisal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muhammad_faisal/32/79213_2.png) [@Muhammad\_Faisal](https://discuss.elastic.co/u/Muhammad_Faisal)\
**Post date:** [December 9, 2020, 1:48pm UTC](https://discuss.elastic.co/t/dateparsefailure/258133/1 "2020-12-09T13:48:20Z")

</div>

hi all,  
i have very simple input , why i am getting date parse failure here ?

`input {  
stdin{}  
}

filter {  
date {  
match =\> ["message", "MMM dd yyyy HH:mm:ss"]  
}  
}

```
    output {
stdout {
        codec => "rubydebug"
}

```

}`

Aug 13 2010 00:03:44

{  
"@version" =\> "1",  
"message" =\> "Aug 13 2010 00:03:44\r",  
"@timestamp" =\> 2020-12-09T12:38:27.872Z,

```
      "tags" => [
    [0] "_dateparsefailure"
]

```

}

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [December 9, 2020, 2:15pm UTC](https://discuss.elastic.co/t/dateparsefailure/258133/2 "2020-12-09T14:15:06Z")

</div>

Your message has a carriage return `\r` at the end of it for some reason. Can add the `gsub` like below to remove it.

But... you did stdin{} so maybe that just captured the carriage return. I tried it and couldn't duplicate that though. Maybe you copy/pasted the message and included the line below it into the command line?

```auto
input {
  generator {
    lines => [
     '{"logdate":"Aug 13 2010 00:03:44\r"}'
    ]
    count => 1
    codec => "json"
  }
}
filter {
  mutate { gsub => ["logdate", "[\r]", "" ] }
  date {
    match => ["logdate", "MMM dd yyyy HH:mm:ss"]
    target => "logdate"
  }
}
output {
  stdout { codec => "rubydebug" }
}

```

Output

```auto
{
      "sequence" => 0,
          "host" => "xxx",
      "@version" => "1",
    "@timestamp" => 2020-12-09T14:10:57.493Z,
       "logdate" => 2010-08-13T06:03:44.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 6, 2021, 2:15pm UTC](https://discuss.elastic.co/t/dateparsefailure/258133/3 "2021-01-06T14:15:16Z")

</div>

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