# Grok pattern for the time which has some character attached to it

**URL:** <https://discuss.elastic.co/t/grok-pattern-for-the-time-which-has-some-character-attached-to-it/219898>\
**Category:** Logstash\
**Created:** [February 19, 2020, 5:16am UTC](https://discuss.elastic.co/t/grok-pattern-for-the-time-which-has-some-character-attached-to-it/219898 "2020-02-19T05:16:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harish\_Kumar2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harish_kumar2/32/57574_2.png) [@Harish\_Kumar2](https://discuss.elastic.co/u/Harish_Kumar2)\
**Post date:** [February 19, 2020, 5:16am UTC](https://discuss.elastic.co/t/grok-pattern-for-the-time-which-has-some-character-attached-to-it/219898/1 "2020-02-19T05:16:17Z")

</div>

i have log beginning with time and time format is like 🙂

**09:16:07.080\_M\_I\_ [10:06] SO(000000000463f2a8 1629 2)**

i tried grok pattern  
grok {

```
match => {"message" => "%{WORD:Timestamp}%{SPACE}%{GREEDYDATA:Logmessage}"}
		}
		}

```

which did not work, i also tried matching the timestamp with matchings like HH:MM:SS.xxx\_Z\_Z\_Z?

can any one help me on this?

---

<div class="post-metadata">

**Author:** ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)\
**Post date:** [February 19, 2020, 8:04am UTC](https://discuss.elastic.co/t/grok-pattern-for-the-time-which-has-some-character-attached-to-it/219898/2 "2020-02-19T08:04:17Z")

</div>

Hi

You could try this (or some variation of it):

```auto
match => {"message" => "%{GREEDYDATA:Timestamp}_%{GREEDYDATA:dummy}%{SPACE}%{GREEDYDATA:Logmessage}"}

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Harish\_Kumar2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harish_kumar2/32/57574_2.png) [@Harish\_Kumar2](https://discuss.elastic.co/u/Harish_Kumar2)\
**Post date:** [February 19, 2020, 8:29am UTC](https://discuss.elastic.co/t/grok-pattern-for-the-time-which-has-some-character-attached-to-it/219898/3 "2020-02-19T08:29:05Z")

</div>

Hi Thank you, I got the solution by tweaking bit more: %{TIME:EventTime}\_%{NOTSPACE}%{SPACE}%{NOTSPACE:HexEvent}%{GREEDYDATA:Message}

---

<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:** [March 18, 2020, 8:29am UTC](https://discuss.elastic.co/t/grok-pattern-for-the-time-which-has-some-character-attached-to-it/219898/4 "2020-03-18T08:29:07Z")

</div>

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