# Help with grok pattern

**URL:** <https://discuss.elastic.co/t/help-with-grok-pattern/272351>\
**Category:** Logstash\
**Created:** [May 7, 2021, 2:15am UTC](https://discuss.elastic.co/t/help-with-grok-pattern/272351 "2021-05-07T02:15:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_a/32/77664_2.png) [@Rahul\_A](https://discuss.elastic.co/u/Rahul_A)\
**Post date:** [May 7, 2021, 2:15am UTC](https://discuss.elastic.co/t/help-with-grok-pattern/272351/1 "2021-05-07T02:15:06Z")

</div>

Hi friends,

I'm a newbie with grok filter and need help parsing the log message.

Here is my log message:  
**2016-07-11T23:56:42.000+00:00 INFO ALERT|ECE002|5 Error with transaction for session -464410bf-37bf-475a-afc0-498e0199f008**

I'm able to parse the message with following pattern:  
**%{TIMESTAMP\_ISO8601:timestamp} %{LOGLEVEL:log-level} %{GREEDYDATA:message}**

I need to parse **ALERT|ECE002|5** from message and get the value ECE002 from the message.

Is there a way to achieve that?

Cheers!

---

<div class="post-metadata">

**Author:** ![lachlan.simpson](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@lachlan.simpson](https://discuss.elastic.co/u/lachlan.simpson)\
**Post date:** [May 7, 2021, 6:32am UTC](https://discuss.elastic.co/t/help-with-grok-pattern/272351/2 "2021-05-07T06:32:36Z")

</div>

I would suggest using `csv` with `source => "message"` and `separator => "|"`

---

<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:** [June 4, 2021, 6:33am UTC](https://discuss.elastic.co/t/help-with-grok-pattern/272351/3 "2021-06-04T06:33:24Z")

</div>

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