# Need help to get only message

**URL:** <https://discuss.elastic.co/t/need-help-to-get-only-message/290123>\
**Category:** Logstash\
**Created:** [November 25, 2021, 5:02am UTC](https://discuss.elastic.co/t/need-help-to-get-only-message/290123 "2021-11-25T05:02:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sushant12](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@sushant12](https://discuss.elastic.co/u/sushant12)\
**Post date:** [November 25, 2021, 5:02am UTC](https://discuss.elastic.co/t/need-help-to-get-only-message/290123/1 "2021-11-25T05:02:47Z")

</div>

logs logging messages in following pattern  
2021-11-03 05:03:22,773,773 DEBUG [controllers.requests] log are logged in to system.

i just want to extract following things so i can store in separate variables :  
Time stamp = 2021-11-03 05:03:22  
message = log are logged in to system  
level = DEBUG

please help me to do this

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [December 7, 2021, 3:59pm UTC](https://discuss.elastic.co/t/need-help-to-get-only-message/290123/2 "2021-12-07T15:59:45Z")

</div>

This is what the grok filter is for.

> **[Grok filter plugin | Logstash Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html)**

Try this:

```auto
%{DATE} %{TIME} %{NOTSPACE:log_level} %{NOTSPACE:type} %{GREEDYDATA:log_message}

```

If you have others I suggest using this website to help you construct your patterns  
[https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/)

---

<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:** [January 4, 2022, 4:00pm UTC](https://discuss.elastic.co/t/need-help-to-get-only-message/290123/3 "2022-01-04T16:00:07Z")

</div>

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