# Grok pattern to extract the fields from the log file

**URL:** https://discuss.elastic.co/t/grok-pattern-to-extract-the-fields-from-the-log-file/262326
**Category:** Logstash
**Created:** [January 27, 2021, 7:25am UTC](https://discuss.elastic.co/t/grok-pattern-to-extract-the-fields-from-the-log-file/262326 "2021-01-27T07:25:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shiv97](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@shiv97](https://discuss.elastic.co/u/shiv97)
#### Post date: [January 27, 2021, 7:25am UTC](https://discuss.elastic.co/t/grok-pattern-to-extract-the-fields-from-the-log-file/262326/1 "2021-01-27T07:25:50Z")

</div>

Hi Everyone,

I am having one log file and I need to parse the message field into multiple subfields for that I need grok parser please look at the log file below:-

message:{"level":"info","ts":1611311978.7658348,"caller":"cloudservices/sqs.go:84","msg":"No messages from SQS received."}

I created grok pattern  
%{LOGLEVEL:level} that fetches the level field but didn't get the way how to fetch other fields

can anyone help me on this

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [January 27, 2021, 4:54pm UTC](https://discuss.elastic.co/t/grok-pattern-to-extract-the-fields-from-the-log-file/262326/2 "2021-01-27T16:54:43Z")

</div>

Why not use a json filter?

---

<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: [February 24, 2021, 4:54pm UTC](https://discuss.elastic.co/t/grok-pattern-to-extract-the-fields-from-the-log-file/262326/3 "2021-02-24T16:54:46Z")

</div>

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