# Date filter not working with AM | PM

**URL:** https://discuss.elastic.co/t/date-filter-not-working-with-am-pm/180199
**Category:** Logstash
**Created:** [May 8, 2019, 2:39pm UTC](https://discuss.elastic.co/t/date-filter-not-working-with-am-pm/180199 "2019-05-08T14:39:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sonukumarsah](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sonukumarsah](https://discuss.elastic.co/u/sonukumarsah)
#### Post date: [May 8, 2019, 2:39pm UTC](https://discuss.elastic.co/t/date-filter-not-working-with-am-pm/180199/1 "2019-05-08T14:39:08Z")

</div>

I have some log file for example this:

{logtimestamp: Mar 29, 2019 11:43:22:948 AM SEVERE: ############SESSION JVM }

As I want to use the timestamp in the log file, I use a data filter to match it

date {  
match =\> ["logtimestamp","MMMM dd, yyyy hh:mm:ss a"]  
target =\> "dateformat"  
}

But when I look into Kibana, I didn't find "dateformat" index.

I also tried with this, but i didn't get  
match =\> ["logtimestamp", "MMMM dd, yyyy HH:mm:ss:SSS"]  
if i remove AM | PM then its working correct, but the problem is how we can identify when it happen.

Can somebody tells me how to fix this?

---

<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 8, 2019, 2:58pm UTC](https://discuss.elastic.co/t/date-filter-not-working-with-am-pm/180199/2 "2019-05-08T14:58:10Z")

</div>

You need to match the milliseconds too

```
match => ["logtimestamp", "MMM dd, yyyy hh:mm:ss:SSS a"]
```

---

<div class="post-metadata">

### Author: ![sonukumarsah](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sonukumarsah](https://discuss.elastic.co/u/sonukumarsah)
#### Post date: [May 9, 2019, 5:44am UTC](https://discuss.elastic.co/t/date-filter-not-working-with-am-pm/180199/3 "2019-05-09T05:44:21Z")

</div>

> [@Badger](#):
>
> "MMM dd, yyyy hh:mm:ss:SSS a"

thank you very much @Badger its working correct what i need exactly same.

---

<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: [June 6, 2019, 5:44am UTC](https://discuss.elastic.co/t/date-filter-not-working-with-am-pm/180199/4 "2019-06-06T05:44:21Z")

</div>

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