# Grok pattern to match multiple results

**URL:** <https://discuss.elastic.co/t/grok-pattern-to-match-multiple-results/259605>\
**Category:** Elasticsearch\
**Created:** [December 24, 2020, 6:49pm UTC](https://discuss.elastic.co/t/grok-pattern-to-match-multiple-results/259605 "2020-12-24T18:49:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Minor\_Vargas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/minor_vargas/32/81279_2.png) [@Minor\_Vargas](https://discuss.elastic.co/u/Minor_Vargas)\
**Post date:** [December 24, 2020, 6:49pm UTC](https://discuss.elastic.co/t/grok-pattern-to-match-multiple-results/259605/1 "2020-12-24T18:49:45Z")

</div>

Hi guys,

I need to match the first line of each log and maybe store it in an array and prepend some metadata at the beginning of each line.. I have a grok pattern that's matching only the first result and ignores the rest.. how can I achieve this? btw, I don't know how many log lines this will have, it will be dynamic.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/c/3c35009225e50e35fcc8715f0741bd898920af8c.png)

The grok pattern goes like this:

"(?m)(?Writing table data)%{GREEDYDATA}"

---

<div class="post-metadata">

**Author:** ![fadjar340](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fadjar340/32/43610_2.png) [@fadjar340](https://discuss.elastic.co/u/fadjar340)\
**Post date:** [December 25, 2020, 8:29am UTC](https://discuss.elastic.co/t/grok-pattern-to-match-multiple-results/259605/2 "2020-12-25T08:29:14Z")

</div>

Please don't use pictures, just send the text within then "```"  
Can't help if the data in picture...

---

<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 22, 2021, 8:29am UTC](https://discuss.elastic.co/t/grok-pattern-to-match-multiple-results/259605/3 "2021-01-22T08:29:24Z")

</div>

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