# Matching date filter with Month in UPPERCASE

**URL:** <https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538>\
**Category:** Logstash\
**Created:** [April 3, 2018, 9:16am UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538 "2018-04-03T09:16:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anisen](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@anisen](https://discuss.elastic.co/u/anisen)\
**Post date:** [April 3, 2018, 9:16am UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538/1 "2018-04-03T09:16:10Z")

</div>

Hi,

The date-timestamp column "time" in my log looks like: **09-FEB-18 05.32.53.045598000 AM**

With the below configuration in logstash, I am getting dateparse failure:

date {  
match =\> ["time", "dd-MMM-yy HH.mm.ss.SSSSSSSSS a"]  
}

Please suggest on how this Month name in UPPERCASE can be handled?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 3, 2018, 9:29am UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538/2 "2018-04-03T09:29:11Z")

</div>

I tried it out in Logstash 6.2 and was not able to reproduce it:

```auto
input {
  generator {
    lines => ['09-FEB-18 05.32.53.045598000 AM']
    count => 1
  } 
} 

filter {
  date {
    match => ["message", "dd-MMM-yy HH.mm.ss.SSSSSSSSS a"]
  }
}

output {
  stdout { codec => rubydebug }
}

```

Resulted in:

```auto
{
  "message" => "09-FEB-18 05.32.53.045598000 AM",
  "@timestamp" => 2018-02-09T05:32:53.045Z,
  "@version" => "1",
  "sequence" => 0,
  "host" => "localhost"
}

```

Are you sure your `time` field contain the correct data?

---

<div class="post-metadata">

**Author:** ![anisen](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@anisen](https://discuss.elastic.co/u/anisen)\
**Post date:** [April 4, 2018, 8:50am UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538/3 "2018-04-04T08:50:44Z")

</div>

Hi,

In the DB, if the time column type is 'varchar()', then it is working.

But giving "dateparsefailure" if the column type is 'timestamp'.

please suggest.

---

<div class="post-metadata">

**Author:** ![Jenni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jenni/32/29684_2.png) [@Jenni](https://discuss.elastic.co/u/Jenni)\
**Post date:** [April 4, 2018, 11:29am UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538/4 "2018-04-04T11:29:51Z")

</div>

Have you tried converting your timestamp to either integer or string with a mutate filter? I can't test it right now, but if that gives you useful results, you could parse the string with your date format pattern or use UNIX\_MS to transform the integer value.

---

<div class="post-metadata">

**Author:** ![anisen](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@anisen](https://discuss.elastic.co/u/anisen)\
**Post date:** [April 4, 2018, 12:06pm UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538/5 "2018-04-04T12:06:14Z")

</div>

Hi,

converting to a string and then using the date filter worked. Thanks.

---

<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, 2018, 12:06pm UTC](https://discuss.elastic.co/t/matching-date-filter-with-month-in-uppercase/126538/6 "2018-05-02T12:06:26Z")

</div>

Closed on May 2, 2018, 12:06pm UTC

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