# Grock Parse Date and time

**URL:** <https://discuss.elastic.co/t/grock-parse-date-and-time/240216>\
**Category:** Logstash\
**Created:** [July 7, 2020, 8:00pm UTC](https://discuss.elastic.co/t/grock-parse-date-and-time/240216 "2020-07-07T20:00:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [July 7, 2020, 8:00pm UTC](https://discuss.elastic.co/t/grock-parse-date-and-time/240216/1 "2020-07-07T20:00:51Z")

</div>

Hi, Im currently parsing the date an time on this log:

```auto
<187>Jul 07 2020 11:29:55:

```

with this Grok

```auto
<%{POSINT:syslog_pri}>%{MONTH:mes} %{MONTHDAY:dia} %{YEAR:año} %{TIME:hora}:

```

Is there a better way to do this?

because after the Groking I have to join those fields, and then remove those fields

---

<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:** [July 7, 2020, 8:05pm UTC](https://discuss.elastic.co/t/grock-parse-date-and-time/240216/2 "2020-07-07T20:05:58Z")

</div>

I would do that using dissect

```
dissect { mapping => { "message" => <%{syslog_pri}>%{[@metadata][timestamp]}" } }
date { match => { "[@metadata][timestamp]" => "MMM dd YYYY HH:mm:ss:" } }
```

---

<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:** [August 4, 2020, 8:06pm UTC](https://discuss.elastic.co/t/grock-parse-date-and-time/240216/3 "2020-08-04T20:06:03Z")

</div>

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