# Grok into a timestamp

**URL:** <https://discuss.elastic.co/t/grok-into-a-timestamp/79946>\
**Category:** Logstash\
**Created:** [March 24, 2017, 8:22pm UTC](https://discuss.elastic.co/t/grok-into-a-timestamp/79946 "2017-03-24T20:22:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhooper](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mhooper](https://discuss.elastic.co/u/mhooper)\
**Post date:** [March 24, 2017, 8:22pm UTC](https://discuss.elastic.co/t/grok-into-a-timestamp/79946/1 "2017-03-24T20:22:53Z")

</div>

What is the cleanest way to match log lines that contain timestamps in this format ﻿[20170324, 00:43:07.637] into @timestamp?

thank you

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 27, 2017, 5:12am UTC](https://discuss.elastic.co/t/grok-into-a-timestamp/79946/2 "2017-03-27T05:12:50Z")

</div>

Use a grok filter to extract the timestamp part of the string into a separate field, then use a date filter with a pattern like `YYYYMMdd, HH:mm:ss.SSS` to parse the string into `@timestamp`.

---

<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:** [April 24, 2017, 5:12am UTC](https://discuss.elastic.co/t/grok-into-a-timestamp/79946/3 "2017-04-24T05:12:56Z")

</div>

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