# Grok pattern construction

**URL:** https://discuss.elastic.co/t/grok-pattern-construction/134142
**Category:** Logstash
**Created:** [June 1, 2018, 5:46am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142 "2018-06-01T05:46:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![hitman](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hitman](https://discuss.elastic.co/u/hitman)
#### Post date: [June 1, 2018, 5:46am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/1 "2018-06-01T05:46:58Z")

</div>

hi guys.....i m new to logsatsh and i am unable to understand this grok filter.i m providing my logs here...can anyone please provide the grok pattern and explain how?

2018-05-25 10:53:21.7529 TRACE Parameter Name : schoolid, Parameter Value : 80

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 1, 2018, 6:17am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/2 "2018-06-01T06:17:21Z")

</div>

Have you tried using the grok constructor web site?

What's the expected result of the grok filter? Is it okay to capture "Parameter Name : schoolid, Parameter Value : 80" into a single field or do you want a `schoolid` field containing 80? If so, do all messages look like this?

---

<div class="post-metadata">

### Author: ![hitman](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hitman](https://discuss.elastic.co/u/hitman)
#### Post date: [June 1, 2018, 6:19am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/3 "2018-06-01T06:19:05Z")

</div>

2018-05-25 10:53:15.8779 TRACE StoredProcedure Name : sp\_gov\_login\_check  
2018-05-25 10:53:15.9561 TRACE Parameter Name : username, Parameter Value : blrprincipal  
2018-05-25 10:53:19.2373 TRACE StoredProcedure Name : sp\_gov\_getusertype  
2018-05-25 10:53:19.2373 TRACE Parameter Name : username, Parameter Value : blrprincipal  
2018-05-25 10:53:19.8623 TRACE StoredProcedure Name : sp\_gov\_login  
2018-05-25 10:53:19.8623 TRACE Parameter Name : username, Parameter Value : blrprincipal  
2018-05-25 10:53:21.7529 TRACE StoredProcedure Name : sp\_gov\_dashboard\_admin\_sk\_getcurriculumprogress  
2018-05-25 10:53:21.7529 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:21.7529 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:21.7529 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:21.7842 TRACE StoredProcedure Name : sp\_gov\_dashboard\_admin\_sk\_getstaffattendnace  
2018-05-25 10:53:21.7842 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:21.7842 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:21.7842 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:21.7998 TRACE StoredProcedure Name : sp\_gov\_dashboard\_admin\_sk\_getstudentsattendnace  
2018-05-25 10:53:21.7998 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:21.7998 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:21.7998 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:22.1592 TRACE StoredProcedure Name : sp\_gov\_dashboard\_admin\_getschoolkpisstatus  
2018-05-25 10:53:22.1592 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.1592 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:22.1592 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:22.3467 TRACE StoredProcedure Name : sp\_notice\_board\_get  
2018-05-25 10:53:22.3467 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.3467 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:22.3467 TRACE Parameter Name : typ, Parameter Value : noticeboard  
2018-05-25 10:53:22.4873 TRACE StoredProcedure Name : sp\_gov\_dashboard\_admin\_sk\_getstudentsmarks  
2018-05-25 10:53:22.4873 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.4873 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:22.4873 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:22.8624 TRACE StoredProcedure Name : sp\_notice\_board\_get  
2018-05-25 10:53:22.8624 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.8624 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:22.8624 TRACE Parameter Name : typ, Parameter Value : timeline  
2018-05-25 10:53:22.8936 TRACE StoredProcedure Name : sp\_gov\_custom\_forms\_getcustomforms  
2018-05-25 10:53:22.8936 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.8936 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:22.8936 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:22.9092 TRACE StoredProcedure Name : sp\_gov\_reports\_getallexporttypes  
2018-05-25 10:53:22.9092 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.9092 TRACE Parameter Name : schoolid, Parameter Value : 80  
2018-05-25 10:53:22.9248 TRACE StoredProcedure Name : sp\_gov\_dashboard\_admin\_getstudentsattendance\_report  
2018-05-25 10:53:22.9248 TRACE Parameter Name : userid, Parameter Value : 3623  
2018-05-25 10:53:22.9248 TRACE Parameter Name : instituteid, Parameter Value : 83  
2018-05-25 10:53:22.9248 TRACE Parameter Name : stateid, Parameter Value : 0  
2018-05-25 10:53:22.9248 TRACE Parameter Name : acyear, Parameter Value : 2017  
2018-05-25 10:53:22.9404 TRACE StoredProcedure Name : sp\_gov\_custom\_forms\_getschoolcustomforms

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 1, 2018, 6:20am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/4 "2018-06-01T06:20:12Z")

</div>

Okay, but that only answers my last question.

---

<div class="post-metadata">

### Author: ![hitman](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hitman](https://discuss.elastic.co/u/hitman)
#### Post date: [June 1, 2018, 6:24am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/5 "2018-06-01T06:24:18Z")

</div>

those r my log files and i need to know how to get grok patern.yeah i used grok constructor ...but as i m new to this i dont understand the results.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 1, 2018, 6:25am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/6 "2018-06-01T06:25:45Z")

</div>

I repeat: What's the expected result of the grok filter? Is it okay to capture "Parameter Name : schoolid, Parameter Value : 80" into a single field or do you want a schoolid field containing 80?

We can't help you if you can't tell us what you expect to get.

What did you come up with so far?

---

<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 29, 2018, 6:30am UTC](https://discuss.elastic.co/t/grok-pattern-construction/134142/8 "2018-06-29T06:30:37Z")

</div>

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