# Date parsing with am:pm?

**URL:** https://discuss.elastic.co/t/date-parsing-with-am-pm/178626
**Category:** Logstash
**Created:** [April 26, 2019, 10:40am UTC](https://discuss.elastic.co/t/date-parsing-with-am-pm/178626 "2019-04-26T10:40:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jeongwoo\_Park](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeongwoo_park/32/42230_2.png) [@Jeongwoo\_Park](https://discuss.elastic.co/u/Jeongwoo_Park)
#### Post date: [April 26, 2019, 10:40am UTC](https://discuss.elastic.co/t/date-parsing-with-am-pm/178626/1 "2019-04-26T10:40:56Z")

</div>

The date in my logs looks like that:  
6월 15, 2018 4:10:20 오후

I tried to parse it like that:

grok {  
match =\> {"message" =\> "%{NUMBER:mon\_num}%{NOTSPACE:month} %{NUMBER:day}, %{YEAR:year} %{TIME:time} %{NOTSPACE:hour\_clock} }  
if "월" in [hour\_clock] {  
mutate {  
update =\> {"hour\_clock" =\> "PM"}  
}  
}

if "\_grokparsefailure" not in [tags] {  
mutate {  
add\_field =\> {"log\_date" =\> "%{year}-%{mon\_num}-%{day} %{time} %{hour\_clock}"}  
add\_field =\> {"log\_message" =\> "%{log\_message\_main}%{log\_message\_detail}"}  
remove\_field =\> ["year", "month", "day", "time", "hour\_clock", "message","log\_message\_detail"]  
}

date {  
match =\> ["log\_date", "yyyy-MM-dd hh:mm:ss aa"]  
}

date {  
match =\> ["log\_date", "yyyy-MM-dd hh:mm:ss aa"]  
target =\> "log\_date"  
}  
}  
}

\_dateparsefailure

**What is the right way to parse this date format?**

---

<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 24, 2019, 10:40am UTC](https://discuss.elastic.co/t/date-parsing-with-am-pm/178626/2 "2019-05-24T10:40:56Z")

</div>

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