# Grok pattern for timestamp with month short name

**URL:** <https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [March 21, 2023, 12:44am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119 "2023-03-21T00:44:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [March 21, 2023, 12:44am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119/1 "2023-03-21T00:44:11Z")

</div>

Wondering how to convert timestamps given like:

```auto
2023-mar.-20 23:44:44 PM

```

to @timestamp and adding a default timezone info

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 21, 2023, 12:49am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119/2 "2023-03-21T00:49:08Z")

</div>

I think you need to pass the locale as well.

What is the locale for this date string?

I know a couple of languages abbreviate March as `mar.`, but you need to use the correct locale because the abbreviation of other months could be different.

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [March 21, 2023, 7:12am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119/3 "2023-03-21T07:12:10Z")

</div>

Right, and how to go about passing that and what std. grok patterns to use for eg. month name and 12 hour clock (AM/PM)?

---

<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:** [March 21, 2023, 7:32am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119/4 "2023-03-21T07:32:18Z")

</div>

Based on the example you provided it looks like you have a 24 hour clock, so AM/PM is redundant and can probably be excluded from date parsing.

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [March 26, 2023, 9:15am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119/5 "2023-03-26T09:15:55Z")

</div>

Turned out we could alter the log format of the source application to match easier/already parsed format of other data from same end point.

---

<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 23, 2023, 9:16am UTC](https://discuss.elastic.co/t/grok-pattern-for-timestamp-with-month-short-name/328119/6 "2023-04-23T09:16:16Z")

</div>

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