# What is the grok pattern for this

**URL:** <https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541>\
**Category:** Elasticsearch\
**Created:** [June 19, 2018, 4:53pm UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541 "2018-06-19T16:53:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![satish161418](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@satish161418](https://discuss.elastic.co/u/satish161418)\
**Post date:** [June 19, 2018, 4:53pm UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541/1 "2018-06-19T16:53:09Z")

</div>

ERROR CODE : -1ERROR MESSAGE : Flow ExceptionERROR : [FFP.0012.0004] Found no valid records.

I need the output like

"ERROR\_CODE": [  
[  
"ERROR CODE" :-1  
]  
]  
"ERROR\_MESSAGE": [  
[  
"ERROR MESSAGE" : Flow ExceptionERROR : [FFP.0012.0004] Found no valid records  
]  
]

---

<div class="post-metadata">

**Author:** ![Jose\_Campos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jose_campos/32/11259_2.png) [@Jose\_Campos](https://discuss.elastic.co/u/Jose_Campos)\
**Post date:** [June 19, 2018, 5:11pm UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541/2 "2018-06-19T17:11:12Z")

</div>

Hi there try with this.

%{GREEDYDATA:ERROR\_CODE}: %{NUMBER:ERROR\_CODE}ERROR MESSAGE : %{GREEDYDATA:ERROR\_MESSAGE}

With grok debugger.

{  
"ERROR\_MESSAGE": "Flow ExceptionERROR\t: [FFP.0012.0004] Found no valid records.",  
"ERROR\_CODE": "-1"  
}

---

<div class="post-metadata">

**Author:** ![satish161418](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@satish161418](https://discuss.elastic.co/u/satish161418)\
**Post date:** [June 19, 2018, 6:04pm UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541/3 "2018-06-19T18:04:40Z")

</div>

> [@Jose\_Campos](#):
>
> %{GREEDYDATA:ERROR\_CODE}: %{NUMBER:ERROR\_CODE}ERROR MESSAGE : %{GREEDYDATA:ERROR\_MESSAGE}

Thans Much JOSe.  
I used your idea and created this  
ERROR CODE : %{BASE10NUM:ERROR\_CODE}ERROR MESSAGE : %{GREEDYDATA:ERROR\_MESSAGE}

grok pattern

{  
"ERROR\_CODE": [  
[  
"-1"  
]  
],  
"ERROR\_MESSAGE": [  
[  
"Flow ExceptionERROR\t: [FFP.0012.0004] Found no valid records"  
]  
]  
}

---

<div class="post-metadata">

**Author:** ![Jose\_Campos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jose_campos/32/11259_2.png) [@Jose\_Campos](https://discuss.elastic.co/u/Jose_Campos)\
**Post date:** [June 19, 2018, 6:30pm UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541/4 "2018-06-19T18:30:20Z")

</div>

I'm glad you it worked

Regards,

---

<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:** [July 17, 2018, 6:30pm UTC](https://discuss.elastic.co/t/what-is-the-grok-pattern-for-this/136541/5 "2018-07-17T18:30:24Z")

</div>

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