# Grok patter to remove trailing milliseconds

**URL:** <https://discuss.elastic.co/t/grok-patter-to-remove-trailing-milliseconds/281643>\
**Category:** Kibana\
**Created:** [August 17, 2021, 8:24am UTC](https://discuss.elastic.co/t/grok-patter-to-remove-trailing-milliseconds/281643 "2021-08-17T08:24:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newmember](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@newmember](https://discuss.elastic.co/u/newmember)\
**Post date:** [August 17, 2021, 8:24am UTC](https://discuss.elastic.co/t/grok-patter-to-remove-trailing-milliseconds/281643/1 "2021-08-17T08:24:56Z")

</div>

Two record formats that start a multiline event, what grok statement might I use to keep the milliseconds and set the time as the @timestamp field? Maybe I have to drop the milliseconds?

Thank you

23:29:53.425: Sending [0,UDP] 467 bytes to 10.80.131.7:5060 \>\>\>\>\>  
@23:29:53.425: Sending [0,UDP] 467 bytes to 10.80.131.7:5060 \>\>\>\>\>

I have been all over the map trying different regex and grok ideas:  
^(@)?(?[^:]_):(?[^:]_):(?[^.]\*)  
(?!\<[0-9])%{HOUR}:%{MINUTE}(?::%{SECOND})(?![0-9])  
TIMESTAMP\_ISO8601  
etc

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [August 19, 2021, 6:16am UTC](https://discuss.elastic.co/t/grok-patter-to-remove-trailing-milliseconds/281643/2 "2021-08-19T06:16:09Z")

</div>

Where are you using those grok patterns (Logstash)? Because we've got a nice channel for that 🙂

---

<div class="post-metadata">

**Author:** ![newmember](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@newmember](https://discuss.elastic.co/u/newmember)\
**Post date:** [August 19, 2021, 1:14pm UTC](https://discuss.elastic.co/t/grok-patter-to-remove-trailing-milliseconds/281643/3 "2021-08-19T13:14:14Z")

</div>

In kabana.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cd927bd719fa7c6ab41ec0b2d66a131335a305b8.png)

---

<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:** [September 16, 2021, 1:15pm UTC](https://discuss.elastic.co/t/grok-patter-to-remove-trailing-milliseconds/281643/4 "2021-09-16T13:15:03Z")

</div>

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